Class: ContainerProfile

Inherits:
Sequel::Model
  • Object
show all
Includes:
ASModel, Relationships
Defined in:
backend/app/model/container_profile.rb

Instance Attribute Summary

Attributes included from Relationships

#cached_relationships

Class Method Summary (collapse)

Instance Method Summary (collapse)

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 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

Class Method Details

+ (Object) sequel_to_jsonmodel(objs, opts = {})



24
25
26
27
28
29
30
31
32
# File 'backend/app/model/container_profile.rb', line 24

def self.sequel_to_jsonmodel(objs, opts = {})
  jsons = super

  jsons.zip(objs).each do |json, obj|
    json['display_string'] = obj.display_string
  end

  jsons
end

Instance Method Details

- (Object) display_string



19
20
21
# File 'backend/app/model/container_profile.rb', line 19

def display_string
  "#{name} [#{depth}d, #{height}h, #{width}w #{dimension_units}] extent measured by #{extent_dimension}"
end

- (Object) validate



13
14
15
16
# File 'backend/app/model/container_profile.rb', line 13

def validate
  super
  validates_unique(:name, :message => "container profile name not unique")
end