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

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup 4/1/2010: “update_attribute is almost never the right thing to use”

Ask for Help

“mp4s do not play during download in chrome”

Talks at Pivotal are recorded and published in various formats. Our talks page has an embedded viewer so that people can watch the video without downloading. We also offer a downloadable version in mp4. Most browsers will play the video as it is downloading. Google Chrome does not. Are we doing something wrong?

Pivotal Talks

Interesting Things

  • Beware: has_many associated objects are saved before has_one associated objects.

  • update_attribute of foreign_key value on belongs_to association does not save…when object was created by factory girl?

This is pretty specific, but perhaps not enough to be useful. The team tried to do an update_attribute on an object generated by factory girl, changing the belongs_to column value. However, no database update would occur. They later resolved this by doing a reload on the object before the update_attribute.

“Update_attribute is almost never the right thing to do” –anon

Comments
  1. Josh Susser says:

    Yes, `update_attribute` (singular) is almost never the right thing to do. In fact, it should probably be deprecated and removed. However, `update_attributes` (plural) is a perfectly cromulent method, and you shouldn’t feel shy about using it at all.

  2. Adam Milligan says:

    Anon. Pfft.

Post a Comment

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

* Copy This Password *

* Type Or Paste Password Here *