aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/refinery/blog/post.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb
index 70c7861..86973da 100644
--- a/app/models/refinery/blog/post.rb
+++ b/app/models/refinery/blog/post.rb
@@ -45,6 +45,12 @@ module Refinery
attr_accessible :browser_title, :meta_description, :meta_keywords, :locale
end
+ # Delegate SEO Attributes to globalize3 translation
+ seo_fields = ::SeoMeta.attributes.keys.map{|a| [a, :"#{a}="]}.flatten
+ delegate(*(seo_fields << {:to => :translation}))
+
+ before_save { |m| m.translation.save }
+
self.per_page = Refinery::Blog.posts_per_page
def next