Module: MongoMapper::Plugins::Callbacks::InstanceMethods
- Defined in:
- lib/novelys_mongo_mapper/plugins/callbacks.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
44 45 46 47 48 49 |
# File 'lib/novelys_mongo_mapper/plugins/callbacks.rb', line 44 def destroy run_callbacks(:before_destroy) result = super run_callbacks(:after_destroy) result end |
#valid? ⇒ Boolean
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/novelys_mongo_mapper/plugins/callbacks.rb', line 32 def valid? action = new? ? 'create' : 'update' run_callbacks(:before_validation) run_callbacks("before_validation_on_#{action}".to_sym) result = super run_callbacks("after_validation_on_#{action}".to_sym) run_callbacks(:after_validation) result end |