module ErpProducts::Extensions::ActiveRecord::ActsAsProductType::ClassMethods
Public Class Methods
find_children(parent_id = nil)
click to toggle source
# File lib/erp_products/extensions/active_record/acts_as_product_type.rb, line 28 def self.find_children(parent_id = nil) ProductType.find_children(parent_id) end
find_roots()
click to toggle source
# File lib/erp_products/extensions/active_record/acts_as_product_type.rb, line 24 def self.find_roots ProductType.find_roots end
Public Instance Methods
acts_as_product_type()
click to toggle source
# File lib/erp_products/extensions/active_record/acts_as_product_type.rb, line 11 def acts_as_product_type() extend ActsAsProductType::SingletonMethods include ActsAsProductType::InstanceMethods after_initialize :initialize_product_type after_create :save_product_type after_update :save_product_type after_destroy :destroy_product_type has_one :product_type, :as => :product_type_record [:children, :description, :description=].each do |m| delegate m, :to => :product_type end def self.find_roots ProductType.find_roots end def self.find_children(parent_id = nil) ProductType.find_children(parent_id) end end