aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy FRERE <frere.jeremy@gmail.com>2012-11-15 13:19:01 +0100
committerJérémy FRERE <frere.jeremy@gmail.com>2012-11-15 13:19:01 +0100
commit5f9b151d01938dde5f5f2716dc3a0de75b02e5d9 (patch)
treec6a7a6184c28590bf3df6740497609ef4b9a78fc
parent50c9adb1956e46d94f6975754acd1fef3fd9256a (diff)
downloadrefinerycms-blog-5f9b151d01938dde5f5f2716dc3a0de75b02e5d9.tar.gz
refinerycms-blog-5f9b151d01938dde5f5f2716dc3a0de75b02e5d9.tar.bz2
refinerycms-blog-5f9b151d01938dde5f5f2716dc3a0de75b02e5d9.zip
Fixes bug with SEO fields translation
-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