How to save one value into the attributes of all rows in a model


#1

When i use Model.all and i want to save this one value into all the
rows of the model how do i do it without using a “for” loop.


#2

On Thu, Apr 9, 2009 at 9:55 AM, tyliong removed_email_address@domain.invalid wrote:

When i use Model.all and i want to save this one value into all the
rows of the model how do i do it without using a “for” loop.

Model.update_all -
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002218

Andrew T.
http://ramblingsonrails.com
http://www.linkedin.com/in/andrewtimberlake

“I have never let my schooling interfere with my education” - Mark Twain