diff options
author | Ken Ip <ken.ip@pushpulllabs.com> | 2013-12-07 22:41:22 -0500 |
---|---|---|
committer | Ken Ip <ken.ip@pushpulllabs.com> | 2013-12-07 22:41:22 -0500 |
commit | 2fdb10b6cdbffac3da022f5cb863e66841052bbb (patch) | |
tree | 8d1871bd7a98daf9f37f7492175a915ae795fc84 | |
parent | 9c4b49b080c6bd1b0ebd286862b1f77b581e5a2d (diff) | |
download | refinerycms-blog-2fdb10b6cdbffac3da022f5cb863e66841052bbb.tar.gz refinerycms-blog-2fdb10b6cdbffac3da022f5cb863e66841052bbb.tar.bz2 refinerycms-blog-2fdb10b6cdbffac3da022f5cb863e66841052bbb.zip |
Apply core globalize fix 2450. Fixes #361.
-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 |