开发者

How to tell if an SQL transaction in rails is successful?

I was wondering how you tell if an sql transaction was successful in rails, does开发者_JAVA百科 it return true or something like that. Or does the code just error on fail?


Activerecord will throw ActiveRecord::Rollback exception when a transaction will fail. See http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html and http://api.rubyonrails.org/classes/ActiveRecord/Rollback.html for more information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜