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.



73
74
75
76
77
# File 'lib/uuid_v7/types/base.rb', line 73

def initialize(value)
  @value = value

  super(value)
end

Instance Method Details

#hexObject



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

def hex
  @value
end