Class: Product

Inherits:
ApplicationRecord show all
Includes:
SharedBehaviour::Deprecatable, SharedBehaviour::Indestructable
Defined in:
app/models/product.rb

Instance Method Summary collapse

Methods included from SharedBehaviour::Deprecatable

#deprecate!, #deprecated?, included

Methods included from SharedBehaviour::Indestructable

included

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#display_nameObject


24
25
26
# File 'app/models/product.rb', line 24

def display_name
  deprecated? ? "#{name} (Deprecated #{deprecated_at.to_formatted_s(:iso8601)})" : name
end

#stock_criteriaObject


20
21
22
# File 'app/models/product.rb', line 20

def stock_criteria
  product_criteria.active.stock.first
end