This project is archived and is in readonly mode.
ActiveRecord::Base#destroy should write 1 line into log
Reported by Dmitry Sokurenko | July 24th, 2008 @ 11:41 AM | in 2.x
Currently SELECTs, INSERTs and UPDATEs generates exactly one line in the log. But DELETEs are logged in 3 lines, because the template for DELETE statements is written using heredocs. It's not convinient to read, nor to parse.
So now it is:
User Load (0.000362) SELECT * FROM `users` WHERE `id` = 1
User Update (0.00050) UPDATE `users` SET `enabled = 0 WHERE `id` = 1
User Destroy (0.000333) DELETE FROM `users`
WHERE `id` = 1
Some other statement
With patch, it would be:
User Load (0.000362) SELECT * FROM `users` WHERE `id` = 1
User Update (0.00050) UPDATE `users` SET `enabled = 0 WHERE `id` = 1
User Destroy (0.000333) DELETE FROM `users`WHERE `id` = 1
Some other statement
So there is a patch and a test for it. Test is a little bit awkward, because I don't know any clean way to test log in Rails.
Comments and changes to this ticket
-
Clemens Kofler July 25th, 2008 @ 12:06 AM
- Tag changed from activerecord, bug, patch to activerecord, enhancement, logging, patch, tested
+1. Doesn't hurt and increases readability.
-
Repository October 29th, 2008 @ 10:23 AM
(from [8f0f07863727edaad1e59df4ab4ec159016917e7]) Make #destroy write 1 line into log (instead of 3) (Dmitry Sokurenko) [#689 status:committed] http://github.com/rails/rails/co...
-
DHH October 29th, 2008 @ 11:16 AM
- State changed from open to committed
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 689 ActiveRecord::Base#destroy should write 1 line into log (from [8f0f07863727edaad1e59df4ab4ec159016917e7]) Make #d...