Sha256: cd819c86d9825eba23f6861d32d44a31dfcc6aca7d3a0a1edf7016bef73d5f63

Contents?: true

Size: 379 Bytes

Versions: 10

Compression:

Stored size: 379 Bytes

Contents

module Globalize2::LocalizedContent
  def localized_content_for *fields
    fields.each do |field|
      class_eval %{
        def #{field}_with_localized_content
          I18n.with_locale(Globalize2Extension.content_locale) do
            #{field}_without_localized_content
          end
        end
      }

      alias_method_chain field, :localized_content
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
radiant-globalize2-extension-0.3.2 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.3.1 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.3.0 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.8 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.7 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.6 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.5 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.4 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.3 lib/globalize2/localized_content.rb
radiant-globalize2-extension-0.2.2 lib/globalize2/localized_content.rb