Skip to content

Commit

Permalink
fixing error in home_controller related to group by (publiclab#2794)
Browse files Browse the repository at this point in the history
* Added group by note.nid

* correction
  • Loading branch information
Souravirus authored and SidharthBansal committed Jun 19, 2018
1 parent dc2a27a commit f0c9065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def activity
.where('node_revisions.status = 1')
.where('timestamp - node.created > ?', 300) # don't report edits within 5 mins of page creation
.limit(10)
.group('node.title')
.group(['node.title', 'node.nid'])
# group by day: http://stackoverflow.com/questions/5970938/group-by-day-from-timestamp
revisions = revisions.group('DATE(FROM_UNIXTIME(timestamp))') if Rails.env == 'production'
revisions = revisions.to_a # ensure it can be serialized for caching
Expand Down

0 comments on commit f0c9065

Please sign in to comment.