Re: [Rails] Update model with array of IDs
On 21.02.2012, at 19:25, Rajarshi Chakravarty wrote:
> Hi,
> I am trying to use the update method of activerecord with an array of
> ids as the first param.
> It does not update any row. The APIs say that it should work.
>
> The array contains 2 IDs.
> RSCampaign.update([1,2], {:end_date =>
> Date.strptime("120228","%y%m%d")})
sorry
RSCampaign.update([1,2], [{:end_date =>Date.strptime("120228","%y%m%d")}]*2)
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home