class MySQLBinUUID::Type::Data
We're inheriting from the Binary type since ActiveRecord in that case will get the hex value. All we need to do to provide the hex value of the UUID, is to return the UUID without dashes. And because this inherits from Binary::Data, ActiveRecord will quote the hex value as required by the database to store it.
Public Class Methods
new(value)
click to toggle source
# File lib/mysql-binuuid/type.rb, line 49 def initialize(value) @value = value end
Public Instance Methods
hex()
click to toggle source
# File lib/mysql-binuuid/type.rb, line 53 def hex @value end