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