Sha256: f2188bf2592a9f4e5d0aceb9f4af587854720d0b9d8a24b963c8b0e9f07cf52f

Contents?: true

Size: 543 Bytes

Versions: 16

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

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

          alias_method :serialize, :deserialize

          def type
            :uuid
          end

          private

            def cast_value(value)
              casted = value.to_s
              casted if casted.match?(ACCEPTABLE_UUID)
            end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
activerecord-6.0.2.2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.2.1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.2.rc2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.2.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.1.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.0 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.0.rc2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.0.rc1 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.0.beta3 lib/active_record/connection_adapters/postgresql/oid/uuid.rb
activerecord-6.0.0.beta2 lib/active_record/connection_adapters/postgresql/oid/uuid.rb