e4011ef211
- schema changes to primary and foreign keys - fixture changes - customer data models subclass AccountScopedRecord - import script updated
15 lines
235 B
Ruby
15 lines
235 B
Ruby
module UuidPrimaryKey
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_create :generate_uuid_primary_key
|
|
end
|
|
|
|
private
|
|
|
|
def generate_uuid_primary_key
|
|
return if id.present?
|
|
self.id = SecureRandom.uuid_v7
|
|
end
|
|
end
|