aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorKen Ip <ken.ip@pushpulllabs.com>2013-12-07 22:41:22 -0500
committerKen Ip <ken.ip@pushpulllabs.com>2013-12-08 00:34:51 -0500
commitf622e6208c167398ca1a0a84bead79283965eeb0 (patch)
tree6bb3d714f278cc07093fc1b3fc891db902f44dbd /app
parent6e147a94b6e6ad0ed773b8ce3f91e1c9fc4cf0cd (diff)
downloadrefinerycms-blog-f622e6208c167398ca1a0a84bead79283965eeb0.tar.gz
refinerycms-blog-f622e6208c167398ca1a0a84bead79283965eeb0.tar.bz2
refinerycms-blog-f622e6208c167398ca1a0a84bead79283965eeb0.zip
Apply core globalize fix 2450. Fixes #361.
Diffstat (limited to 'app')
-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