Module: Mongoid::Publishable::Callbacks

Defined in:
lib/mongoid/publishable/callbacks.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/mongoid/publishable/callbacks.rb', line 8

def self.included(base)
  base.extend ClassMethods
  base.send :include, InstanceMethods
  base.class_eval do
    # handle after_publish callbacks
    after_save :process_after_publish_callbacks, if: :run_after_publish_callbacks?
  end
end