LoginSignup
29
22

More than 5 years have passed since last update.

Rails console からmysqlのレコードの内容を更新する方法

Last updated at Posted at 2017-04-17

rails cからレコード内容をupdateする(コールバック走る)

User.find(1).update_attributes(name: "James")

rails cからレコード内容をupdateする(コールバック走らない)

User.find(1).update_column(:name, "James")
29
22
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
29
22