aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/refinery
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2014-01-27 11:41:56 +0200
committerUģis Ozols <ugis.ozolss@gmail.com>2014-01-27 11:41:56 +0200
commitde653854e58fe20239df67a0bd5db0576d7ddf89 (patch)
tree7d38b953709319a66d326333d9219e820d3b24cd /app/helpers/refinery
parentbada2a8033f32856edfd681395e7cd652af5cf08 (diff)
downloadrefinerycms-blog-de653854e58fe20239df67a0bd5db0576d7ddf89.tar.gz
refinerycms-blog-de653854e58fe20239df67a0bd5db0576d7ddf89.tar.bz2
refinerycms-blog-de653854e58fe20239df67a0bd5db0576d7ddf89.zip
Use strong parameters.
Diffstat (limited to 'app/helpers/refinery')
-rw-r--r--app/helpers/refinery/blog/controller_helper.rb9
1 files changed, 4 insertions, 5 deletions
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