18
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails 4 の AR#update 周りまとめ

18
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?