Module: MongoMapper::Plugins::Callbacks::InstanceMethods

Defined in:
lib/mongo_mapper/plugins/callbacks.rb,
lib/mongo_mapper/plugins/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



28
29
30
31
32
33
34
35
36
# File 'lib/mongo_mapper/plugins/callbacks.rb', line 28

def destroy
  result = nil

  _run_destroy_callbacks do
    result = super
  end

  result
end

#valid?Boolean

Returns:



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mongo_mapper/plugins/callbacks.rb', line 15

def valid?
  action = new? ? 'create' : 'update'
  result = nil

  _run_validation_callbacks do
    self.send("_run_validation_on_#{action}_callbacks") do
      result = super
    end
  end

  result
end