阅读背景:

如何挽救模型交易并向用户显示错误?

来源:互联网 

So imagine you have 2 models, Person and Address, and only one address per person can be marked as 'Main'. So if I wanna change a person's main address, I need to use a transaction, to mark the new one as main and unmark the old one. And as far as I know using transactions in controllers is not good so I have a special method in model, thats what I've got:So imagine you have 2 models, Person and Addres




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: