Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 07/21/2008

Interesting Things

  • Model#update_all is your friend if you’re not yet on Rails 2.1

    Like Model#update_attribute for each attribute, #update_all will save direct to the database, bypassing validation, updating only the columns you specify. In Rails 2.1, with partial model updates, you may not need this. But if you’ve not yet upgraded your application, then give #update_all a try.

Update: fixed per comment. Model#update_attribute does not validate. Thanks for the catch!

  1. Stijn says:

    Model#update_all is indeed great, but it’s Model#update_attribute that skips the validation checks (not update_attribute*s*).

  2. Davis W. Frank says:

    Stijn – thanks for the catch. Now fixed.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *