diff options
author | Uģis Ozols <ugis.ozolss@gmail.com> | 2010-12-03 13:01:12 +0200 |
---|---|---|
committer | Uģis Ozols <ugis.ozolss@gmail.com> | 2010-12-03 13:01:12 +0200 |
commit | deca138ec9054488233f100a22edd12acdeaaf58 (patch) | |
tree | 19eb3fb100b7717d0620144a486434c439e82081 | |
parent | 0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2 (diff) | |
download | refinerycms-blog-deca138ec9054488233f100a22edd12acdeaaf58.tar.gz refinerycms-blog-deca138ec9054488233f100a22edd12acdeaaf58.tar.bz2 refinerycms-blog-deca138ec9054488233f100a22edd12acdeaaf58.zip |
Reduce db queries.
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index f489039..f7b6f3c 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -67,7 +67,7 @@ protected end def find_all_blog_posts - @blog_posts = BlogPost.live.paginate({ + @blog_posts = BlogPost.live.includes(:comments, :categories).paginate({ :page => params[:page], :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) }) |