I would like to be able to do the following : UPDATE table SET column1 = column2 + column3 -> for the whole table , and it is simply impossible with the current form of update_all ! I have to use simple update or ActiveRecord::Base.connection.execute to get the job done ... I think this should be a key feature for the future. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/0ZVfpCvJO1cJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Nicolás Sanguinetti
2013-Jan-04 10:27 UTC
Re: update_all isn''t as expressive as it should be
What''s wrong with Model.update_all(''column1 = column2 +
column3'') ?
This has been possible since forever :)
Cheers,
-foca
On Fri, Jan 4, 2013 at 6:46 AM, Radu Dinca <radudinca@gmail.com>
wrote:> I would like to be able to do the following :
>
> UPDATE table SET column1 = column2 + column3 -> for the whole table ,
and
> it is simply impossible with the current form of update_all !
>
> I have to use simple update or ActiveRecord::Base.connection.execute to get
> the job done ... I think this should be a key feature for the future.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/0ZVfpCvJO1cJ.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.