diff options
-rw-r--r-- | app/models/refinery/blog/post.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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 |