开发者

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

开发者 https://www.devze.com 2023-03-31 05:46 出处:网络
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 Activ

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

精彩评论

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

关注公众号