Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid

Inherits:
Type::Value
  • Object
show all
Defined in:
lib/active_record/connection_adapters/postgresql/oid/uuid.rb

Overview

:nodoc:

Constant Summary collapse

ACCEPTABLE_UUID =
%r{\A\{?([a-fA-F0-9]{4}-?){8}\}?\z}x

Instance Method Summary collapse

Instance Method Details

#cast(value) ⇒ Object



14
15
16
# File 'lib/active_record/connection_adapters/postgresql/oid/uuid.rb', line 14

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

#typeObject



10
11
12
# File 'lib/active_record/connection_adapters/postgresql/oid/uuid.rb', line 10

def type
  :uuid
end