Module: Shared::AutoUuid

Extended by:
ActiveSupport::Concern
Included in:
BiologicalAssociation, Extract, Otu
Defined in:
app/models/concerns/shared/auto_uuid.rb

Overview

If included ensures Object allways has a UUID

Instance Method Summary collapse

Instance Method Details

#create_object_uuidObject (private)



28
29
30
31
32
33
34
35
# File 'app/models/concerns/shared/auto_uuid.rb', line 28

def create_object_uuid
  @uuid_identifier = Identifier::Global::Uuid::Auto.create!(
    by: self.created_by_id,
    project_id: self.project_id,
    identifier_object: self,
    is_generated: true
  )
end

#generate_uuid_if_requiredObject (private)



24
25
26
# File 'app/models/concerns/shared/auto_uuid.rb', line 24

def generate_uuid_if_required
  create_object_uuid if !uuid_identifier
end