Rails update_attribute gotcha

  • Rails

Model#update_attribute(:name, "Rando") does not trigger any validations, even on name and just saves it to the database.

Model#update_attributes(:name => "Rando") does run all validations, and returns false if they fail.

Rails docs