From 5f9b151d01938dde5f5f2716dc3a0de75b02e5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20FRERE?= Date: Thu, 15 Nov 2012 13:19:01 +0100 Subject: Fixes bug with SEO fields translation --- app/models/refinery/blog/post.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') 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 -- cgit v1.2.3