Module: Notes
- Included in:
- AgentCorporateEntity, AgentFamily, AgentPerson, AgentSoftware, ArchivalObject, DigitalObject, DigitalObjectComponent, Resource
- Defined in:
- backend/app/model/mixins/notes.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) persistent_id_context
-
- (Object) update_from_json(json, opts = {}, apply_nested_records = true)
Class Method Details
+ (Object) included(base)
7 8 9 10 11 12 13 |
# File 'backend/app/model/mixins/notes.rb', line 7 def self.included(base) base.one_to_many :note Note.many_to_one base.table_name base.extend(ClassMethods) end |
Instance Method Details
- (Object) persistent_id_context
22 23 24 25 26 27 28 29 30 31 32 |
# File 'backend/app/model/mixins/notes.rb', line 22 def persistent_id_context if self.respond_to?(:root_record_id) && self.root_record_id parent_id = self.root_record_id parent_type = self.class.root_record_type.to_s else parent_id = self.id parent_type = self.class.my_jsonmodel.record_type end [parent_id, parent_type] end |
- (Object) update_from_json(json, opts = {}, apply_nested_records = true)
16 17 18 19 |
# File 'backend/app/model/mixins/notes.rb', line 16 def update_from_json(json, opts = {}, apply_nested_records = true) obj = super self.class.apply_notes(obj, json) end |