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
- #create_object_uuid ⇒ Object private
- #generate_uuid_if_required ⇒ Object private
Instance Method Details
#create_object_uuid ⇒ Object (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_required ⇒ Object (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 |