Class: Product

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

Overview

rubocop:todo Style/Documentation

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 Squishify

extended

Instance Method Details

#display_nameObject


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

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

#stock_criteriaObject


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

def stock_criteria
  product_criteria.active.stock.first
end