Module: ActsAsProtocolable::ClassMethods
- Defined in:
- lib/acts_as_protocolable.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_protocolable(options = {}) ⇒ Object
5 6 7 |
# File 'lib/acts_as_protocolable.rb', line 5 def acts_as_protocolable( = {}) self.acts_as_protocolable_model() end |
#acts_as_protocolable_model(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/acts_as_protocolable.rb', line 9 def acts_as_protocolable_model( = {}) include ActsAsProtocolable::InstanceMethods unless .has_key?(:only) after_create :protocol_on_create after_update :protocol_on_update after_destroy :protocol_on_destroy else [:only].each do |action| class_eval("after_#{action.to_s} :protocol_on_#{action.to_s}") end end end |