Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] force create() to fetch quoted attributes once

#2958

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.

Reported by jd · July 26th, 2009 @ 03:37 AM

State: resolved
Milestone: 3.x
Assigned to: Michael Koziarski Michael Koziarski
Importance: none

Activity

  1. jd
    jd

    Oops, wrong API token I guess. I update the patch.

    July 26th, 2009 @ 03:40 AM

  2. jd
  3. jd
    jd

    Not really crucial, but still I poke.

    September 6th, 2009 @ 09:39 PM

  4. Dmitry Polushkin
    Dmitry Polushkin
    • Assigned user set to Michael Koziarski

    September 7th, 2009 @ 09:48 AM

  5. jd
  6. jd
    jd

    Hi. Any chance to get this reviewed? :)

    December 21st, 2009 @ 11:38 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  8. Rohit Arondekar
    Rohit Arondekar
    • 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.

    October 9th, 2010 @ 04:01 AM

  9. jd
    jd

    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.

    October 10th, 2010 @ 07:46 PM

  10. Rohit Arondekar
    Rohit Arondekar
    • State changed from stale to resolved

    jd, thanks for the quick reply! :)

    October 14th, 2010 @ 10:22 AM