Permalink
Browse files

Fix group_by_day

  • Loading branch information...
jdurand committed Apr 17, 2015
1 parent d4fbfca commit 1f2963d255f56be6c2766fab3f2b232836e39ad6
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/upmin/railties/dashboard.rb
@@ -38,12 +38,9 @@ def last_date
# Group by
#
def group_by_day
dates = where.not('created_at' => nil).group('date(created_at)').order('date(created_at) ASC').count
dates = where.not(created_at: nil).group('date(created_at)').order('date(created_at) ASC').count
# Convert sqlite String date keys to Date keys
dates.map! { |k, v| [Date.parse(k), v] } if dates.keys.first.is_a? String
return dates
dates.map { |k, v| [Date.parse(k), v] } if dates.keys.first.is_a? String
end
def group_by_week

1 comment on commit 1f2963d

@oss92

This comment has been minimized.

Show comment
Hide comment
@oss92

oss92 May 3, 2017

you mean introduce a bug in group_by_day?

oss92 commented on 1f2963d May 3, 2017

you mean introduce a bug in group_by_day?

Please sign in to comment.