Class: ContainerProfile

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.sequel_to_jsonmodel(objs, opts = {}) ⇒ Object



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

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

#display_stringObject



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

def display_string
  I18n.t("container_profile.title", :name => name, :depth => depth, :height => height, :width => width, :dimension_units => dimension_units, :extent_dimension => extent_dimension)
end

#validateObject



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

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