Module: Mongoid::Callbacks::ClassMethods
- Defined in:
- lib/mongoid/callbacks.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.
306 307 308 309 310 311 |
# File 'lib/mongoid/callbacks.rb', line 306 def observable(*args) observables = args.flat_map do |name| [ :"before_#{name}", :"after_#{name}", :"around_#{name}" ] end Callbacks.registered_observables.concat(observables).uniq end |