Module: Mongoid::Interceptable::ClassMethods
- Defined in:
- lib/mongoid/observers/interceptable.rb
Instance Method Summary collapse
-
#observable(*args) ⇒ Object
Set a custom callback as able to be observed.
Instance Method Details
#observable(*args) ⇒ Object
Set a custom callback as able to be observed.
44 45 46 47 48 49 |
# File 'lib/mongoid/observers/interceptable.rb', line 44 def observable(*args) observables = args.flat_map do |name| [ :"before_#{name}", :"after_#{name}", :"around_#{name}" ] end Interceptable.registered_observables.concat(observables).uniq end |