Module: PyrRules::ModelEventEmitter
- Included in:
- Rule
- Defined in:
- app/rules/pyr_rules/model_event_emitter.rb
Constant Summary collapse
- @@registered_classes =
[]
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/rules/pyr_rules/model_event_emitter.rb', line 32 def self.included(base) #base.send :extend, ClassMethods #unless ( File.basename($0) == "rake" && ARGV.include?("db:migrate") ) #end base.after_save :raise_updated base.after_create :raise_created base.before_destroy :raise_destroyed @@registered_classes << base if !registered_classes.index(base) end |
.model_actions ⇒ Object
46 47 48 |
# File 'app/rules/pyr_rules/model_event_emitter.rb', line 46 def self.model_actions [:create, :update, :delete] end |
.registered_classes ⇒ Object
42 43 44 |
# File 'app/rules/pyr_rules/model_event_emitter.rb', line 42 def self.registered_classes @@registered_classes end |