Class: UuidV7::Types::Base::Data

Inherits:
ActiveModel::Type::Binary::Data
  • Object
show all
Defined in:
lib/uuid_v7/types/base.rb

Overview

We need to override the hex method to avoid unpacking when quoting ActiveRecord calls hex method when quoting a value. github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb#L57

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Data

Returns a new instance of Data.



77
78
79
80
81
# File 'lib/uuid_v7/types/base.rb', line 77

def initialize(value)
  @value = value

  super
end

Instance Method Details

#hexObject



83
84
85
# File 'lib/uuid_v7/types/base.rb', line 83

def hex
  @value
end