Fix N+1 queries problem in /explore/posts/popular.json.
This commit is contained in:
@@ -51,11 +51,11 @@ module Explore
|
||||
end
|
||||
|
||||
def popular_posts(min_date, max_date)
|
||||
Post.where(created_at: min_date..max_date).user_tag_match("order:score")
|
||||
Post.where(created_at: min_date..max_date).includes(:media_asset).user_tag_match("order:score")
|
||||
end
|
||||
|
||||
def curated_posts(min_date, max_date)
|
||||
Post.where(created_at: min_date..max_date).user_tag_match("order:curated")
|
||||
Post.where(created_at: min_date..max_date).includes(:media_asset).user_tag_match("order:curated")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user