エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
How to generate ActiveRecord insert SQL (Example)
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
How to generate ActiveRecord insert SQL (Example)
I came up with this a while back in response to a question asked on Twitter. I just came across i... I came up with this a while back in response to a question asked on Twitter. I just came across it after being asked about it again, yet I've never had a use for it myself. This will give you the SQL INSERT statement generated by ActiveRecord for the attribute values set on the model instance. record = Post.new(:title => 'Yay', :body => 'This is some insert SQL') # easiest way to achieve this is b