I have a mongoid document (in a rails app) that has failed validation. I want to reset all of the invalid fields. Currently I am doing this:
@product.errors.each do |e,m|
method_name = "reset_#{e}!"
@product.send(method_name)
end
This is ok, but is there not a better (more concise) way to do this? I've read the dirty tracking documentation and googled, but I can't find anything about this.