Module: Mongo::Model::Callbacks

Defined in:
lib/mongo_db/model/callbacks.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#_run_callbacks(type, method_name) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/mongo_db/model/callbacks.rb', line 4

def _run_callbacks type, method_name
  if type == :before
    run_before_callbacks method_name, method: method_name
  elsif type == :after
    run_after_callbacks method_name, method: method_name
  else
    raise "invalid callback type (#{type})!"
  end
end