Class: CustomMetadatumCollection
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- CustomMetadatumCollection
- Includes:
- Uuid::Uuidable
- Defined in:
- app/models/custom_metadatum_collection.rb
Instance Method Summary collapse
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Instance Method Details
#metadata ⇒ Object
11 12 13 |
# File 'app/models/custom_metadatum_collection.rb', line 11 def .collect(&:to_h).inject(:merge!) || {} end |
#metadata=(attributes) ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/models/custom_metadatum_collection.rb', line 15 def (attributes) ActiveRecord::Base.transaction do .clear attributes.each { |k, v| .build(key: k, value: v) } end end |