Sha256: 8011c74ee5fc3f7603367a80403c0dbf303de48cf637ab7aeedbd0f44dd113c2

Contents?: true

Size: 394 Bytes

Versions: 35

Compression:

Stored size: 394 Bytes

Contents

module ActiveRecord
  module TypeCaster
    class Map # :nodoc:
      def initialize(types)
        @types = types
      end

      def type_cast_for_database(attr_name, value)
        return value if value.is_a?(Arel::Nodes::BindParam)
        type = types.type_for_attribute(attr_name.to_s)
        type.serialize(value)
      end

      protected

      attr_reader :types
    end
  end
end

Version data entries

35 entries across 35 versions & 4 rubygems

Version Path
activerecord-5.0.7.2 lib/active_record/type_caster/map.rb
activerecord-5.0.7.1 lib/active_record/type_caster/map.rb
activerecord-5.0.7 lib/active_record/type_caster/map.rb
activerecord-5.0.6 lib/active_record/type_caster/map.rb
activerecord-5.0.6.rc1 lib/active_record/type_caster/map.rb
activerecord-5.0.5 lib/active_record/type_caster/map.rb
activerecord-5.0.5.rc2 lib/active_record/type_caster/map.rb
activerecord-5.0.5.rc1 lib/active_record/type_caster/map.rb
activerecord-5.0.4 lib/active_record/type_caster/map.rb
activerecord-5.0.4.rc1 lib/active_record/type_caster/map.rb
activerecord-5.0.3 lib/active_record/type_caster/map.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-5.0.2/lib/active_record/type_caster/map.rb
activerecord-5.0.2 lib/active_record/type_caster/map.rb
activerecord-5.0.2.rc1 lib/active_record/type_caster/map.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.1/lib/active_record/type_caster/map.rb