| Class | Opensteam::InventoryBase::Inventory |
| In: |
lib/opensteam/inventory_base.rb
|
| Parent: | ActiveRecord::Base |
Inventory Model
define property accessor methods, like "Inventory.find(:first).colors"
# File lib/opensteam/inventory_base.rb, line 71
71: def self.define_property_accessors
72: Opensteam::Base::PropertyBase.properties.each do |accessor|
73: self.class_eval do
74: define_method( accessor.tableize ) { accessor.classify.constantize.find(:all) }
75: end
76: end
77: end
check if inventory-object is active
# File lib/opensteam/inventory_base.rb, line 81
81: def is_active?() active == 1 ; end
checks if inventory-object is available
# File lib/opensteam/inventory_base.rb, line 84
84: def is_available?() storage > 0 && is_active? ; end