maybe fix optional username

This commit is contained in:
Andrew Tomaka 2015-04-28 10:39:33 -04:00
parent 6069583960
commit 5c7842f37d

2
app.rb
View file

@ -32,7 +32,7 @@ post '/' do
end end
get '/bossfight/?:username' do get '/bossfight/?:username' do
@username = params['username'] ? params['username'] : 'mafiaman' @username = params['username'] != '' ? params['username'] : 'mafiaman'
user_raids = Raid.for_user(@username) user_raids = Raid.for_user(@username)
@first_negative = user_raids.first_negative @first_negative = user_raids.first_negative
@soldiers_killed = user_raids.soldiers_lost_to_date(@first_negative.created_at) @soldiers_killed = user_raids.soldiers_lost_to_date(@first_negative.created_at)