阅读背景:

Rails ActiveRecord update_all ids数组

来源:互联网 

I have an ActiveRecord Model called Animal. Animal has id and client_id. In my app have an array called @selectedanimals that contains the id's of the animals I want to update such as: @selectedanimals: ["6", "14", "5"]. I have the value of a new client_id for these animals like @newclient.id and I want to update all of these Animal records with the new client_id. What I have now is:I have an ActiveRecord Model called Animal. Ani




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

分享到: