diff --git a/app/models/rails_admin/history.rb b/app/models/rails_admin/history.rb index b00433a548..f3269b8e91 100644 --- a/app/models/rails_admin/history.rb +++ b/app/models/rails_admin/history.rb @@ -20,7 +20,7 @@ def self.get_history_for_dates(mstart, mstop, ystart, ystop) if mstart > mstop && mstart < 12 results = History.find_by_sql(["select count(*) as record_count, year, month from rails_admin_histories where month IN (?) and year = ? group by year, month", ((mstart + 1)..12).to_a, ystart]) - results_two = History.find_by_sql(["select count(*) as number, year, month from rails_admin_histories where month IN (?) and year = ? group by year, month", + results_two = History.find_by_sql(["select count(*) as record_count, year, month from rails_admin_histories where month IN (?) and year = ? group by year, month", (1..mstop).to_a, ystop]) results.concat(results_two)