Module: Shared::AutoUuid
- Extended by:
- ActiveSupport::Concern
- Included in:
- AnatomicalPart, 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
- #create_object_uuid ⇒ Object private
- #generate_uuid_if_required ⇒ Object private
Instance Method Details
#create_object_uuid ⇒ Object (private)
32 33 34 35 36 37 38 39 |
# File 'app/models/concerns/shared/auto_uuid.rb', line 32 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_required ⇒ Object (private)
28 29 30 |
# File 'app/models/concerns/shared/auto_uuid.rb', line 28 def generate_uuid_if_required create_object_uuid if uuid_required && !uuid_identifier end |