Class: Accession
- Inherits:
-
JSONModel
- Object
- JSONModel
- Accession
- Includes:
- ASModel, Agents, AutoGenerator, Classifications, CollectionManagements, Dates, Deaccessions, DirectionalRelationships, Events, Extents, ExternalDocuments, ExternalIDs, Identifiers, Instances, MapToAspaceContainer, Publishable, ReindexTopContainers, Relationships, RightsStatements, Subjects, Transferable, UserDefineds
- Defined in:
- backend/app/model/accession.rb,
frontend/app/models/accession.rb
Constant Summary
Constant Summary
Constants included from Identifiers
Instance Attribute Summary (collapse)
-
- (Object) resource_link
Returns the value of attribute resource_link.
Attributes included from Relationships
Instance Method Summary (collapse)
Methods included from MapToAspaceContainer
included, mapper_to_aspace_json, mapper_to_managed_container, #update_from_json
Methods included from ReindexTopContainers
#delete, #reindex_top_containers, #reindex_top_containers_by_any_means_necessary, #update_from_json, #update_position_only
Methods included from Publishable
Methods included from Events
Methods included from Transferable
Methods included from AutoGenerator
Methods included from Classifications
Methods included from UserDefineds
Methods included from Instances
Methods included from CollectionManagements
Methods included from ExternalIDs
Methods included from DirectionalRelationships
Methods included from Relationships
#assimilate, #cache_relationships, included, #my_relationships, #related_records, #transfer_to_repository, #trigger_reindex_of_dependants, #update_from_json
Methods included from Agents
Methods included from Deaccessions
Methods included from RightsStatements
Methods included from ExternalDocuments
Methods included from Dates
Methods included from Subjects
Methods included from Extents
Methods included from Identifiers
#after_initialize, #before_validation, format, #id_0=, #id_1=, #id_2=, #id_3=, included, parse, #validate
Methods included from ASModel
all_models, included, update_publish_flag, update_suppressed_flag
Methods included from JSONModel
JSONModel, #JSONModel, add_error_handler, all, allow_unmapped_enum_value, backend_url, client_mode?, custom_validations, destroy_model, enum_default_value, enum_values, handle_error, init, load_schema, #models, models, parse_jsonmodel_ref, parse_reference, repository, repository_for, schema_src, set_repository, strict_mode, strict_mode?, with_repository
Instance Attribute Details
- (Object) resource_link
Returns the value of attribute resource_link
2 3 4 |
# File 'frontend/app/models/accession.rb', line 2 def resource_link @resource_link end |
Instance Method Details
- (Object) populate_from_accession(accession)
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'frontend/app/models/accession.rb', line 24 def populate_from_accession(accession) values = accession.to_hash(:raw) # Recursively remove bits that don't make sense to copy (like "lock_version" properties) values = JSONSchemaUtils.map_hash_with_schema(values, JSONModel(:accession).schema, [proc { |hash, schema| hash = hash.clone hash.delete_if {|k, v| k.to_s =~ /^(id_[0-9]|lock_version)$/} hash }]) prepare_for_clone(values) self.update(values) end |
- (Object) ref_id
11 12 13 14 15 16 17 18 19 20 21 |
# File 'frontend/app/models/accession.rb', line 11 def ref_id ref_id = "" (0..3).each do |i| next if self.send("id_#{i.to_s}").blank? ref_id << " - " unless i === 0 ref_id << self.send("id_#{i.to_s}") end ref_id end |