-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
So I have a model and I am doing some validation inside after_save callback, if the validation fails I need to call the destroy method on the model. But when I do that, I get this error?
Mongoid::Errors::Callback: Calling save! on ChatMessage resulted in a false return from a callback. from /Users/kapilisrani/.rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.10/lib/mongoid/persistence.rb:267:in `fail_callback!' from /Users/kapilisrani/.rvm/gems/ruby-1.9.3-p194/gems/mongoid-2.4.10/lib/mongoid/persistence.rb:77:in `save!' from (irb):128
Using Mongoid 2.4.10 with Rails 3.2.6