Class: ActiveRecord::Type::UUID

Inherits:
Binary
  • Object
show all
Defined in:
lib/activeuuid/patches.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#cast(value) ⇒ Object



22
23
24
# File 'lib/activeuuid/patches.rb', line 22

def cast(value)
  cast_value value
end

#cast_value(value) ⇒ Object



18
19
20
# File 'lib/activeuuid/patches.rb', line 18

def cast_value(value)
  UUIDTools::UUID.serialize(value)
end

#serialize(value) ⇒ Object



13
14
15
16
# File 'lib/activeuuid/patches.rb', line 13

def serialize(value)
  return if value.nil?
  UUIDTools::UUID.serialize(value)
end

#typeObject



9
10
11
# File 'lib/activeuuid/patches.rb', line 9

def type
  :uuid
end