From de653854e58fe20239df67a0bd5db0576d7ddf89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ug=CC=A7is=20Ozols?= Date: Mon, 27 Jan 2014 11:41:56 +0200 Subject: Use strong parameters. --- app/helpers/refinery/blog/controller_helper.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app/helpers/refinery') diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb index 4bec046..a300148 100644 --- a/app/helpers/refinery/blog/controller_helper.rb +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -5,10 +5,9 @@ module Refinery protected def find_blog_post - @post = all_blog_posts.friendly.find(params[:id]) - unless @post.try(:live?) - if refinery_user? && current_refinery_user.authorized_plugins.include?("refinerycms_blog") - @post = Post.friendly.find(params[:id]) + unless (@post = Refinery::Blog::Post.with_globalize.friendly.find(params[:id])).try(:live?) + if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog") + @post = Refinery::Blog::Post.friendly.find(params[:id]) else error_404 end @@ -16,7 +15,7 @@ module Refinery end def find_all_blog_posts - @posts = all_blog_posts.live + @posts = Refinery::Blog::Post.live.includes(:comments, :categories).with_globalize.page(params[:page]) end def find_tags -- cgit v1.2.3