こんにちは、三苫です。 ActiveRecordのトランザクションについてちょっとしたtipsです。 以下のActiveRecordを使ったrubyコードがどのようなクエリを発行するだろう? Entity.transaction do Entity.transaction do Entity.create!(name: "hoge") end Entity.transaction do Entity.create!(name: "moge") raise ActiveRecord::Rollback end end