aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Arndt <p@arndt.io>2013-12-07 21:42:58 -0800
committerPhilip Arndt <p@arndt.io>2013-12-07 21:42:58 -0800
commitb03a46d6a1ba8fabd33c3d4fb1f437c2730f103c (patch)
tree6bb3d714f278cc07093fc1b3fc891db902f44dbd
parent6e147a94b6e6ad0ed773b8ce3f91e1c9fc4cf0cd (diff)
parentf622e6208c167398ca1a0a84bead79283965eeb0 (diff)
downloadrefinerycms-blog-b03a46d6a1ba8fabd33c3d4fb1f437c2730f103c.tar.gz
refinerycms-blog-b03a46d6a1ba8fabd33c3d4fb1f437c2730f103c.tar.bz2
refinerycms-blog-b03a46d6a1ba8fabd33c3d4fb1f437c2730f103c.zip
Merge pull request #363 from kenips/globalize_fix_master
Apply core globalize fix 2450. Fixes #361.
-rw-r--r--app/models/refinery/blog/post.rb5
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