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

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.

On Thu, Apr 9, 2009 at 9:55 AM, tyliong [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs