Sha256: 1290091806b4231ee95eba76527b322dd1df62bb16304e78e75eca3ff940e069

Contents?: true

Size: 625 Bytes

Versions: 5

Compression:

Stored size: 625 Bytes

Contents

module SimpleModelTranslations
  module Attributes
    def attributes=(attributes)
      I18n.with_locale(attributes.delete(:locale) || translation_helper.current_locale_for_translation) do
        super(attributes)
      end
    end

    def update_attributes!(attributes)
      I18n.with_locale(attributes.delete(:locale) || translation_helper.current_locale_for_translation) do
        super(attributes)
      end
    end

    def update_attributes(attributes)
      I18n.with_locale(attributes.delete(:locale) || translation_helper.current_locale_for_translation) do
        super(attributes)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_model_translations-0.2.8 lib/simple_model_translations/attributes.rb
simple_model_translations-0.2.7 lib/simple_model_translations/attributes.rb
simple_model_translations-0.2.6 lib/simple_model_translations/attributes.rb
simple_model_translations-0.2.5 lib/simple_model_translations/attributes.rb
simple_model_translations-0.2.4 lib/simple_model_translations/attributes.rb