This project is archived and is in readonly mode.
[PATCH] force create() to fetch quoted attributes once
Reported by jd | July 26th, 2009 @ 03:37 AM | in 3.x
In ActiveRecord::Base, the private method create() first fetches quoted attributes with attributes_with_quotes. It then may build a custom SQL statement, where quoted_column_names() is called. This in turns triggers a second call to attributes_with_quotes() since it is used as the method's default parameter.
This single-line patch prevents from calling attributes_with_quotes() twice by supplying the fetched quoted attributes as the parameter when calling quoted_column_names(). I assumed standard rake tests are enough.
Note: this is my first patch proposal, feel free to tell me what may be wrong.
Comments and changes to this ticket
-
Dmitry Polushkin September 7th, 2009 @ 09:48 AM
- Assigned user set to Michael Koziarski
-
Rohit Arondekar October 9th, 2010 @ 04:01 AM
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
-
jd October 10th, 2010 @ 07:46 PM
Rails 2.8 is not affected anymore by the bug, for the internals have been streamlined a little bit.
Rails 3 changed the way requests are performed this is no longer an issue in mainstream.One could now close this ticket, I guess.
-
Rohit Arondekar October 14th, 2010 @ 10:22 AM
- State changed from stale to resolved
jd, thanks for the quick reply! :)
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>