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 Piyush Swain committed Oct 22, 2020
1 parent 4e482ee commit a194918
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 a194918

Please sign in to comment.