Commit 2c6eb234079ff1175574257f7131d9986317e9f1

Authored by Rodrigo Souto
1 parent 0fb6c374

content-viewer-controller: include relations on posts to avoid database multiple repetitive queries

ActionItem3201
app/controllers/public/content_viewer_controller.rb
... ... @@ -83,6 +83,8 @@ class ContentViewerController < ApplicationController
83 83 @page.posts
84 84 end
85 85  
  86 + posts = posts.includes(:parent, {:profile => [:domains, :environment]})
  87 +
86 88 #FIXME Need to run this before the pagination because this version of
87 89 # will_paginate returns a will_paginate collection instead of a
88 90 # relation.
... ...