This project is archived and is in readonly mode.

#2958 ✓resolved

[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

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=""></a>