Skip to content

Commit

Permalink
remove n+1 query from revision#path method (publiclab#8191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda authored and shubhangikori committed Oct 12, 2020
1 parent bbae9e7 commit 88436ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def activity
.order('nid DESC')
.limit(10)
revisions = Revision.joins(:node)
.includes(:node)
.order('timestamp DESC')
.where('type = (?)', 'page')
.where('node.status = 1')
Expand Down

0 comments on commit 88436ae

Please sign in to comment.