diff --git a/app.rb b/app.rb index 7220fa5..bb91e4b 100644 --- a/app.rb +++ b/app.rb @@ -37,8 +37,6 @@ get '/bossfight' do @first_negative = user_raids.first_negative @soldiers_killed = user_raids.soldiers_lost_to_date(@first_negative.created_at) @contributers = user_raids.contributors(@first_negative.created_at) - require 'pp' - pp @contributers erb :bossfight end diff --git a/models/raid.rb b/models/raid.rb index d5593f7..276e23d 100644 --- a/models/raid.rb +++ b/models/raid.rb @@ -18,10 +18,10 @@ class Raid < ActiveRecord::Base end def self.soldiers_lost_to_date(date) - where('created_at < ?', date).sum(:soldiers) + where('created_at <= ?', date).sum(:soldiers) end def self.contributors(date) - where('created_at < ?', date).group(:attacker).sum(:soldiers) + where('created_at <= ?', date).group(:attacker).sum(:soldiers) end end diff --git a/views/bossfight.erb b/views/bossfight.erb index 235f679..015c051 100644 --- a/views/bossfight.erb +++ b/views/bossfight.erb @@ -19,7 +19,23 @@ -
Attacker | +Attempts | +Soldiers Killed | +
<%= contributer[0]%> | ++ | <%= readable_number(contributer[1]) %> | +