All get rolled back, that’s the whole point of a transaction. But you’ll need to use save! instead of save so that an exception is raised causing the transaction to fail.
Cool.transaction(cool, bad, sad) do
cool.name = “rufus”
bad.name = “ratty”
sad.name = “kinglsey”
rescue ActiveRecord::RecordInvalid => e