Sha256: 480958e9fc39a4caa22992c6a80f1f3564fa9b6e4a514a18f7424284f8a1e6a1

Contents?: true

Size: 460 Bytes

Versions: 45

Compression:

Stored size: 460 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module PostgreSQL
      module OID # :nodoc:
        class Uuid < Type::Value # :nodoc:
          ACCEPTABLE_UUID = %r{\A\{?([a-fA-F0-9]{4}-?){8}\}?\z}x

          alias_method :type_cast_for_database, :type_cast_from_database

          def type
            :uuid
          end

          def type_cast(value)
            value.to_s[ACCEPTABLE_UUID, 0]
          end
        end
      end
    end
  end
end

Version data entries

45 entries across 44 versions & 8 rubygems

Version Path
activerecord-4.2.11.3 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.11.2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.11.1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.11 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.10 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.10.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.9 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.9.rc2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.9.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.8 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.8.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.7.1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.7 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.7.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.6 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.6.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-4.2.5.2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activejob-lock-0.0.2 rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/uuid.rb