Sha256: 1840055b10fe7551d5aaa5a512f9a01f20b0f7995c3a716ca2c443c974667f90

Contents?: true

Size: 380 Bytes

Versions: 15

Compression:

Stored size: 380 Bytes

Contents

module ActiveRecord
  module Type
    class HashLookupTypeMap < TypeMap # :nodoc:
      delegate :key?, to: :@mapping

      def alias_type(type, alias_type)
        register_type(type) { |_, *args| lookup(alias_type, *args) }
      end

      private

      def perform_fetch(type, *args, &block)
        @mapping.fetch(type, block).call(type, *args)
      end
    end
  end
end

Version data entries

15 entries across 14 versions & 4 rubygems

Version Path
activejob-lock-0.0.2 rails/activerecord/lib/active_record/type/hash_lookup_type_map.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activerecord-4.2.2/lib/active_record/type/hash_lookup_type_map.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activerecord-4.2.1/lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.2 lib/active_record/type/hash_lookup_type_map.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.1/lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.1 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.1.rc4 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.1.rc3 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.1.rc2 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.1.rc1 lib/active_record/type/hash_lookup_type_map.rb
activejob-lock-0.0.1 rails/activerecord/lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.0 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.0.rc3 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.0.rc2 lib/active_record/type/hash_lookup_type_map.rb
activerecord-4.2.0.rc1 lib/active_record/type/hash_lookup_type_map.rb