Sha256: 8ba905abb7ea39e4d780eb1fb6eaa0b655d73a20f445b77798ae8449effb9c7a

Contents?: true

Size: 388 Bytes

Versions: 38

Compression:

Stored size: 388 Bytes

Contents

require 'active_record/serializers/xml_serializer'

ActiveRecord::XmlSerializer::Attribute.class_eval do
  def compute_type_with_translations
    klass = @serializable.class
    if klass.translates? && klass.translated_attribute_names.include?(name.to_sym)
      :string
    else
      compute_type_without_translations
    end
  end
  alias_method_chain :compute_type, :translations
end

Version data entries

38 entries across 38 versions & 7 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/globalize-5.0.1/lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.5 lib/patches/active_record/xml_attribute_serializer.rb
globalize-5.0.1 lib/patches/active_record/xml_attribute_serializer.rb
globalize-5.0.0 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.3 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.2 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.1 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.1.0 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.4 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0.alpha.5 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0.alpha.4 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.3 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0.alpha.3 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.2 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.1 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0.alpha.2 lib/patches/active_record/xml_attribute_serializer.rb
globalize-3.0.0 lib/patches/active_record/xml_attribute_serializer.rb
globalize3-0.3.1 lib/patches/active_record/xml_attribute_serializer.rb
globalize-4.0.0.alpha.1 lib/patches/active_record/xml_attribute_serializer.rb