LoginSignup
18
18

More than 5 years have passed since last update.

Rails 4 の AR#update 周りまとめ

Posted at
メソッド invoke validation invoke callback raise exception 補足
update(attributes) o o x
update!(attributes) o o o
update_attribute(name, value) x o x boolean flag の update が主な目的?
update_attributes(attributes) o o x update の alias
update_attributes!(attributes) o o o update! の alias
update_column(name, value) x x x updated_columns(name: value) と同じ
update_columns(attributes) x x x 最速でレコード更新できる。updated_at が更新されない
18
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
18