aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Arndt <p@arndt.io>2013-12-07 20:54:46 -0800
committerPhilip Arndt <p@arndt.io>2013-12-07 20:54:46 -0800
commit346046e37058e39c741b657e4f33dd850e430558 (patch)
tree8d1871bd7a98daf9f37f7492175a915ae795fc84
parent9c4b49b080c6bd1b0ebd286862b1f77b581e5a2d (diff)
parent2fdb10b6cdbffac3da022f5cb863e66841052bbb (diff)
downloadrefinerycms-blog-346046e37058e39c741b657e4f33dd850e430558.tar.gz
refinerycms-blog-346046e37058e39c741b657e4f33dd850e430558.tar.bz2
refinerycms-blog-346046e37058e39c741b657e4f33dd850e430558.zip
Merge pull request #362 from kenips/globalize_fix
Brings in @shioyama's globalize fix to refinerycms-blog
-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