是否整个restful动词属于一个包含所有包含权的交易?也就是说,如果我在处理UPDATE,DELETE或CREATE操作的任何时候在验证或回调中引发错误,那么我在之前的回调中执行的每个数据库操作是否也会回滚?简而言之,是否在任何回调或验证时引发错误使得数据库中的动词操作根本没有发生任何变化?
解决方法
Is it the case that the entire restful verb is under a single all encompassing transaction?
没有
if I raise a Error in the validation or callbacks at any point in the handling of a UPDATE,DELETE,or CREATE operation,is every database operation that I may have performed in prevIoUs callbacks also rolled back?
没有.
does raising a Error on any callback or validation make it such that no change at all occurs in the database for that verb action?
没有.
如果您需要此行为,您可以在控制器中显式创建事务(请参阅其他用户提供的示例),或使用around_filter将行为附加到您的所有restful操作.