Skip to content

Commit 26c6595

Browse files
committed
save player name & username
1 parent 0cf534f commit 26c6595

3 files changed

Lines changed: 78 additions & 70 deletions

File tree

Gemfile.lock

Lines changed: 72 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actionmailer (4.2.6)
5-
actionpack (= 4.2.6)
6-
actionview (= 4.2.6)
7-
activejob (= 4.2.6)
4+
actionmailer (4.2.7)
5+
actionpack (= 4.2.7)
6+
actionview (= 4.2.7)
7+
activejob (= 4.2.7)
88
mail (~> 2.5, >= 2.5.4)
99
rails-dom-testing (~> 1.0, >= 1.0.5)
10-
actionpack (4.2.6)
11-
actionview (= 4.2.6)
12-
activesupport (= 4.2.6)
10+
actionpack (4.2.7)
11+
actionview (= 4.2.7)
12+
activesupport (= 4.2.7)
1313
rack (~> 1.6)
1414
rack-test (~> 0.6.2)
1515
rails-dom-testing (~> 1.0, >= 1.0.5)
1616
rails-html-sanitizer (~> 1.0, >= 1.0.2)
17-
actionview (4.2.6)
18-
activesupport (= 4.2.6)
17+
actionview (4.2.7)
18+
activesupport (= 4.2.7)
1919
builder (~> 3.1)
2020
erubis (~> 2.7.0)
2121
rails-dom-testing (~> 1.0, >= 1.0.5)
2222
rails-html-sanitizer (~> 1.0, >= 1.0.2)
23-
activejob (4.2.6)
24-
activesupport (= 4.2.6)
23+
activejob (4.2.7)
24+
activesupport (= 4.2.7)
2525
globalid (>= 0.3.0)
26-
activemodel (4.2.6)
27-
activesupport (= 4.2.6)
26+
activemodel (4.2.7)
27+
activesupport (= 4.2.7)
2828
builder (~> 3.1)
29-
activerecord (4.2.6)
30-
activemodel (= 4.2.6)
31-
activesupport (= 4.2.6)
29+
activerecord (4.2.7)
30+
activemodel (= 4.2.7)
31+
activesupport (= 4.2.7)
3232
arel (~> 6.0)
33-
activesupport (4.2.6)
33+
activesupport (4.2.7)
3434
i18n (~> 0.7)
3535
json (~> 1.7, >= 1.7.7)
3636
minitest (~> 5.1)
3737
thread_safe (~> 0.3, >= 0.3.4)
3838
tzinfo (~> 1.1)
3939
addressable (2.4.0)
4040
arel (6.0.3)
41-
autoprefixer-rails (6.3.6)
41+
autoprefixer-rails (6.3.7)
4242
execjs
43-
awesome_print (1.6.1)
43+
awesome_print (1.7.0)
4444
axiom-types (0.1.1)
4545
descendants_tracker (~> 0.0.4)
4646
ice_nine (~> 0.11.0)
4747
thread_safe (~> 0.3, >= 0.3.1)
48-
bourbon (4.2.6)
48+
bourbon (4.2.7)
4949
sass (~> 3.4)
5050
thor (~> 0.19)
5151
builder (3.2.2)
52-
bullet (5.0.0)
52+
bullet (5.1.1)
5353
activesupport (>= 3.0.0)
54-
uniform_notifier (~> 1.9.0)
54+
uniform_notifier (~> 1.10.0)
5555
bundler-audit (0.5.0)
5656
bundler (~> 1.2)
5757
thor (~> 0.18)
58-
byebug (8.2.4)
59-
capybara (2.7.0)
58+
byebug (9.0.5)
59+
capybara (2.7.1)
6060
addressable
6161
mime-types (>= 1.16)
6262
nokogiri (>= 1.3.3)
6363
rack (>= 1.0.0)
6464
rack-test (>= 0.5.4)
6565
xpath (~> 2.0)
66-
capybara-webkit (1.10.1)
66+
capybara-webkit (1.11.1)
6767
capybara (>= 2.3.0, < 2.8.0)
6868
json
6969
coderay (1.1.1)
@@ -76,15 +76,15 @@ GEM
7676
coffee-script-source
7777
execjs
7878
coffee-script-source (1.10.0)
79-
concurrent-ruby (1.0.1)
79+
concurrent-ruby (1.0.2)
8080
crack (0.4.3)
8181
safe_yaml (~> 1.0.0)
82-
database_cleaner (1.5.1)
82+
database_cleaner (1.5.3)
8383
debug_inspector (0.0.2)
84-
delayed_job (4.1.1)
85-
activesupport (>= 3.0, < 5.0)
86-
delayed_job_active_record (4.1.0)
87-
activerecord (>= 3.0, < 5)
84+
delayed_job (4.1.2)
85+
activesupport (>= 3.0, < 5.1)
86+
delayed_job_active_record (4.1.1)
87+
activerecord (>= 3.0, < 5.1)
8888
delayed_job (>= 3.0, < 5)
8989
descendants_tracker (0.0.4)
9090
thread_safe (~> 0.3, >= 0.3.1)
@@ -96,7 +96,7 @@ GEM
9696
railties (>= 4.0, < 5.1)
9797
equalizer (0.0.11)
9898
erubis (2.7.0)
99-
execjs (2.6.0)
99+
execjs (2.7.0)
100100
factory_girl (4.7.0)
101101
activesupport (>= 3.0.0)
102102
factory_girl_rails (4.7.0)
@@ -112,7 +112,7 @@ GEM
112112
globalid (0.3.6)
113113
activesupport (>= 4.1.0)
114114
hashdiff (0.3.0)
115-
high_voltage (2.4.0)
115+
high_voltage (3.0.0)
116116
i18n (0.7.0)
117117
ice_nine (0.11.2)
118118
jquery-rails (4.1.1)
@@ -128,49 +128,51 @@ GEM
128128
mail (2.6.4)
129129
mime-types (>= 1.16, < 4)
130130
method_source (0.8.2)
131-
mime-types (3.0)
131+
mime-types (3.1)
132132
mime-types-data (~> 3.2015)
133-
mime-types-data (3.2016.0221)
134-
mini_portile2 (2.0.0)
135-
minitest (5.8.4)
133+
mime-types-data (3.2016.0521)
134+
mini_portile2 (2.1.0)
135+
minitest (5.9.0)
136136
multipart-post (2.0.0)
137137
neat (1.7.4)
138138
bourbon (>= 4.0)
139139
sass (>= 3.3)
140-
newrelic_rpm (3.15.1.316)
141-
nokogiri (1.6.7.2)
142-
mini_portile2 (~> 2.0.0.rc2)
140+
newrelic_rpm (3.16.0.318)
141+
nokogiri (1.6.8)
142+
mini_portile2 (~> 2.1.0)
143+
pkg-config (~> 1.1.7)
143144
normalize-rails (3.0.3)
144145
pg (0.18.4)
145-
pry (0.10.3)
146+
pkg-config (1.1.7)
147+
pry (0.10.4)
146148
coderay (~> 1.1.0)
147149
method_source (~> 0.8.1)
148150
slop (~> 3.4)
149-
pry-byebug (3.3.0)
150-
byebug (~> 8.0)
151+
pry-byebug (3.4.0)
152+
byebug (~> 9.0)
151153
pry (~> 0.10)
152154
pry-rails (0.3.4)
153155
pry (>= 0.9.10)
154156
puma (3.4.0)
155157
quiet_assets (1.1.0)
156158
railties (>= 3.1, < 5.0)
157159
rack (1.6.4)
158-
rack-canonical-host (0.2.1)
160+
rack-canonical-host (0.2.2)
159161
addressable (> 0, < 3)
160162
rack (>= 1.0.0, < 3)
161163
rack-test (0.6.3)
162164
rack (>= 1.0)
163165
rack-timeout (0.4.2)
164-
rails (4.2.6)
165-
actionmailer (= 4.2.6)
166-
actionpack (= 4.2.6)
167-
actionview (= 4.2.6)
168-
activejob (= 4.2.6)
169-
activemodel (= 4.2.6)
170-
activerecord (= 4.2.6)
171-
activesupport (= 4.2.6)
166+
rails (4.2.7)
167+
actionmailer (= 4.2.7)
168+
actionpack (= 4.2.7)
169+
actionview (= 4.2.7)
170+
activejob (= 4.2.7)
171+
activemodel (= 4.2.7)
172+
activerecord (= 4.2.7)
173+
activesupport (= 4.2.7)
172174
bundler (>= 1.3.0, < 2.0)
173-
railties (= 4.2.6)
175+
railties (= 4.2.7)
174176
sprockets-rails
175177
rails-deprecated_sanitizer (1.0.3)
176178
activesupport (>= 4.2.0.alpha)
@@ -180,12 +182,12 @@ GEM
180182
rails-deprecated_sanitizer (>= 1.0.1)
181183
rails-html-sanitizer (1.0.3)
182184
loofah (~> 2.0)
183-
railties (4.2.6)
184-
actionpack (= 4.2.6)
185-
activesupport (= 4.2.6)
185+
railties (4.2.7)
186+
actionpack (= 4.2.7)
187+
activesupport (= 4.2.7)
186188
rake (>= 0.8.7)
187189
thor (>= 0.18.1, < 2.0)
188-
rake (11.1.2)
190+
rake (11.2.2)
189191
recipient_interceptor (0.1.2)
190192
mail
191193
refills (0.1.0)
@@ -208,8 +210,8 @@ GEM
208210
rspec-support (3.4.1)
209211
safe_yaml (1.0.4)
210212
sass (3.4.22)
211-
sass-rails (5.0.4)
212-
railties (>= 4.0.0, < 5.0)
213+
sass-rails (5.0.5)
214+
railties (>= 4.0.0, < 6)
213215
sass (~> 3.1)
214216
sprockets (>= 2.8, < 4.0)
215217
sprockets-rails (>= 2.0, < 4.0)
@@ -219,47 +221,47 @@ GEM
219221
simple_form (3.2.1)
220222
actionpack (> 4, < 5.1)
221223
activemodel (> 4, < 5.1)
222-
simplecov (0.11.2)
224+
simplecov (0.12.0)
223225
docile (~> 1.1.0)
224-
json (~> 1.8)
226+
json (>= 1.8, < 3)
225227
simplecov-html (~> 0.10.0)
226228
simplecov-html (0.10.0)
227229
slop (3.6.0)
228-
spring (1.7.1)
230+
spring (1.7.2)
229231
spring-commands-rspec (1.0.4)
230232
spring (>= 0.9.1)
231-
sprockets (3.6.0)
233+
sprockets (3.6.3)
232234
concurrent-ruby (~> 1.0)
233235
rack (> 1, < 3)
234-
sprockets-rails (3.0.4)
236+
sprockets-rails (3.1.1)
235237
actionpack (>= 4.0)
236238
activesupport (>= 4.0)
237239
sprockets (>= 3.0.0)
238-
telegram-bot-ruby (0.5.0)
240+
telegram-bot-ruby (0.5.2)
239241
faraday
240242
virtus
241243
thor (0.19.1)
242244
thread_safe (0.3.5)
243-
tilt (2.0.2)
245+
tilt (2.0.5)
244246
timecop (0.8.1)
245-
title (0.0.5)
247+
title (0.0.7)
246248
i18n
247249
rails (>= 3.1)
248250
tzinfo (1.2.2)
249251
thread_safe (~> 0.1)
250252
uglifier (3.0.0)
251253
execjs (>= 0.3.0, < 3)
252-
uniform_notifier (1.9.0)
254+
uniform_notifier (1.10.0)
253255
virtus (1.0.5)
254256
axiom-types (~> 0.1)
255257
coercible (~> 1.0)
256258
descendants_tracker (~> 0.0, >= 0.0.3)
257259
equalizer (~> 0.0, >= 0.0.9)
258-
web-console (3.1.1)
260+
web-console (3.3.0)
259261
activemodel (>= 4.2)
260262
debug_inspector
261263
railties (>= 4.2)
262-
webmock (1.24.3)
264+
webmock (2.1.0)
263265
addressable (>= 2.3.6)
264266
crack (>= 0.3.2)
265267
hashdiff

lib/pickup_bot/commands/join.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ def initialize(telegram_bot, message)
1212
def run
1313
if game_exists?
1414
current_player = Player.find_or_create_by(telegram_user_id: message.from.id)
15+
current_player.first_name = message.from.first_name
16+
current_player.last_name = message.from.last_name
17+
current_player.username = message.from.username
18+
current_player.save
19+
1520
attendence = Attendance.new(game: current_game, player: current_player)
1621
attendence.save
1722
telegram_bot.api.send_message(

spec/lib/pickup_bot/commands/join_game_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
)).to have_been_made.times(1)
5252
expect(Player.count).to eq 1
5353
expect(Game.last.attendances.count).to eq 1
54+
expect(Player.last.first_name).to eq message.from.first_name
5455
end
5556

5657
scenario "existing player joins game" do

0 commit comments

Comments
 (0)