From 32bc0bb0e3adb0a3ce025724b51b7d413a554e27 Mon Sep 17 00:00:00 2001 From: Patrick Davey Date: Thu, 17 Oct 2013 08:55:13 +1300 Subject: Restricting tags to live posts --- app/helpers/refinery/blog/controller_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb index 87d5447..edbf934 100644 --- a/app/helpers/refinery/blog/controller_helper.rb +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -19,7 +19,7 @@ module Refinery end def find_tags - @tags = Refinery::Blog::Post.tag_counts_on(:tags) + @tags = Refinery::Blog::Post.live.tag_counts_on(:tags) end def find_all_blog_categories @categories = Refinery::Blog::Category.translated -- cgit v1.2.3 From f622e6208c167398ca1a0a84bead79283965eeb0 Mon Sep 17 00:00:00 2001 From: Ken Ip Date: Sat, 7 Dec 2013 22:41:22 -0500 Subject: Apply core globalize fix 2450. Fixes #361. --- app/models/refinery/blog/post.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index f0278f4..cf0a526 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -47,7 +47,10 @@ module Refinery seo_fields = ::SeoMeta.attributes.keys.map{|a| [a, :"#{a}="]}.flatten delegate(*(seo_fields << {:to => :translation})) - before_save { |m| m.translation.save } + before_save do |m| + m.translation.globalized_model = self + m.translation.save if m.translation.new_record? + end self.per_page = Refinery::Blog.posts_per_page -- cgit v1.2.3