Sha256: 24c5a20af5f296e9eb5122dad5a3722f6261db93f4a8587ff384efaf2e96d7b3

Contents?: true

Size: 438 Bytes

Versions: 121

Compression:

Stored size: 438 Bytes

Contents

# frozen_string_literal: true

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

      def type_cast_for_database(attr_name, value)
        type = type_for_attribute(attr_name)
        type.serialize(value)
      end

      def type_for_attribute(name)
        klass.type_for_attribute(name)
      end

      private
        attr_reader :klass
    end
  end
end

Version data entries

121 entries across 116 versions & 11 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.7/lib/active_record/type_caster/map.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/active_record/type_caster/map.rb
activerecord-8.0.1 lib/active_record/type_caster/map.rb
activerecord-8.0.0.1 lib/active_record/type_caster/map.rb
activerecord-7.2.2.1 lib/active_record/type_caster/map.rb
activerecord-7.1.5.1 lib/active_record/type_caster/map.rb
activerecord-7.0.8.7 lib/active_record/type_caster/map.rb
activerecord-8.0.0 lib/active_record/type_caster/map.rb
activerecord-7.2.2 lib/active_record/type_caster/map.rb
activerecord-7.1.5 lib/active_record/type_caster/map.rb
activerecord-8.0.0.rc2 lib/active_record/type_caster/map.rb
activerecord-7.2.1.2 lib/active_record/type_caster/map.rb
activerecord-7.1.4.2 lib/active_record/type_caster/map.rb
activerecord-7.0.8.6 lib/active_record/type_caster/map.rb
activerecord-6.1.7.10 lib/active_record/type_caster/map.rb
activerecord-8.0.0.rc1 lib/active_record/type_caster/map.rb
activerecord-6.1.7.9 lib/active_record/type_caster/map.rb
activerecord-7.2.1.1 lib/active_record/type_caster/map.rb
activerecord-7.1.4.1 lib/active_record/type_caster/map.rb
activerecord-7.0.8.5 lib/active_record/type_caster/map.rb