def attributes_with_locale=(new_attributes, guard_protected_attributes = true)
      return if new_attributes.nil?
      attributes = new_attributes.dup
      attributes.stringify_keys!

      attributes = sanitize_for_mass_assignment(attributes) if guard_protected_attributes
      send(:locale=, attributes["locale"]) if attributes.has_key?("locale") and respond_to?(:locale=)

      send(:attributes_without_locale=, attributes, guard_protected_attributes)
    end
def attributes_with_locale=(new_attributes, guard_protected_attributes = true)
      return if new_attributes.nil?
      attributes = new_attributes.dup
      attributes.stringify_keys!

      attributes = sanitize_for_mass_assignment(attributes) if guard_protected_attributes
      send(:locale=, attributes["locale"]) if attributes.has_key?("locale") and respond_to?(:locale=)

      send(:attributes_without_locale=, attributes, guard_protected_attributes)
    end
Override the default mass assignment method so that the locale variable is always
 given preference.