Module: ErpBaseErpSvcs::Extensions::ActiveRecord::ActsAsCategory::ClassMethods

Defined in:
lib/erp_base_erp_svcs/extensions/active_record/acts_as_category.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_categoryObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/erp_base_erp_svcs/extensions/active_record/acts_as_category.rb', line 10

def acts_as_category
      extend ActsAsCategory::SingletonMethods
	include ActsAsCategory::InstanceMethods
	
 after_initialize :initialize_category
	after_create :save_category
	after_update :save_category
	after_destroy :destroy_category
					
 has_one :category, :as => :category_record
end