21 Mar '13, 11pm
@plukevdh oh yeah that's a real PITA. You can set raise_on_save_failure to bubble up the validation error.
Sometimes though, you either don't need the extra safety you get from dm-validations , or you don't want any callbacks to be invoked at all. In situations like this, you can use the bang(!) versions of the respective methods. You will probably find yourself using these unsafe methods when performing internal manipulation of resources as opposed to, say, persisting attribute values entered by users (in which case you'd most likely use the safe versions). If you call #save! instead of #save , no callbacks and no validations will be run. DataMapper just assumes that you know what you do. This can also have severe impact on the performance of some operations. If you're calling #save! , #update! or #destroy! on a (large) DataMapper::Collection , this will result in much better performance than calling the safe non-bang counterparts. This is because DataMapper won't load the col...