エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Railsでカラムの値を更新するのは "update_attribute", "update_attributes", それとも "update_attributes!" - (゚∀゚)o彡 sasata299's blog
記事へのコメント8件
- 注目コメント
- 新着コメント
![invent invent](https://cdn.profile-image.st-hatena.com/users/invent/profile.png)
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Railsでカラムの値を更新するのは "update_attribute", "update_attributes", それとも "update_attributes!" - (゚∀゚)o彡 sasata299's blog
2010年09月13日22:57 Ruby Railsでカラムの値を更新するのは "update_attribute", "update_attributes",... 2010年09月13日22:57 Ruby Railsでカラムの値を更新するのは "update_attribute", "update_attributes", それとも "update_attributes!" さ。というわけで、この3つのメソッドが良く似てて、「たまに使おうと思ったらどれ使ったらいいかわかんない(覚えてない)んですけどー」という話です。 まぁ、忘れたときのためにここにまとめておきましょう!3つとも lib/active_record/persistence.rb にメソッドが定義されていました。(Rails 3.0 の場合) 1) update_attribute メソッド def update_attribute(name, value) name = name.to_s raise ActiveRecordError, "#{name} is marked as
2014/05/12 リンク