Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5548 (closed defect: duplicate)

Opened 4 years ago

Last modified 3 years ago

[PATCH] Fix for bug #3403 (broken finder_sql interpolation)

Reported by: rob@oxdi.eu Assigned to: David
Priority: high Milestone: 1.2.4
Component: ActiveRecord Version: 1.2.3
Severity: major Keywords: finder_sql unverified
Cc: bitsweat, michael@schuerig.de, theflinnster@gmail.com

Description

This problem fixes the issue, unfortunately I don't have much time to work on this and breakpoint wouldn't function inside of that file. I am unsure if @owner is the correct instance variable to interpolate with in all instances and unsure if all instances should be interpolated (but a casual look suggests they should).

This didn't affect any current unit tests (run under the sqlite3 store), and it does fix the issue, but needs someone who better knows how this file works to check that each place interpolate_sql is called is correct.

NOTE: If you made this file and don't understand why you can't just interpolate it once - we can't put #{id} in there and have it interpolated if you interpolate once and then cache the result as it will always be the ID of the first record that accessed the relationship, which is broken.

Attachments

3403.patch (1.7 kB) - added by rob@oxdi.eu on 06/29/06 12:03:31.

Change History

06/29/06 12:03:31 changed by rob@oxdi.eu

  • attachment 3403.patch added.

06/29/06 12:14:08 changed by rob@oxdi.eu

  • version deleted.

The version number was wrong.

06/29/06 16:02:34 changed by bitsweat

  • cc set to bitsweat.
  • keywords set to finder_sql.
  • version set to 1.1.1.
  • milestone set to 1.2.

Looks like a good start - please provide unit tests verifying the correct behavior.

07/05/06 01:48:50 changed by david

  • keywords changed from finder_sql to finder_sql unverified.
  • summary changed from [PATCH][UNVERIFIED] Fix for bug #3403 (broken finder_sql interpolation) to [PATCH] Fix for bug #3403 (broken finder_sql interpolation).

07/08/06 01:12:01 changed by bitsweat

Any progress on this issue?

09/03/06 19:37:39 changed by anonymous

  • cc changed from bitsweat to bitsweat, michael@schuerig.de.

09/07/06 14:48:24 changed by rob@oxdi.eu

Sorry about lack of progress, I haven't had the internet at home for a couple of months as I've moved and can't justify constructing unit tests for this at work right now. I'm expecting to get internet next week so I will construct unit tests for this then.

06/26/07 22:42:21 changed by acts_as_flinn

  • cc changed from bitsweat, michael@schuerig.de to bitsweat, michael@schuerig.de, theflinnster@gmail.com.
  • version changed from 1.1.1 to 1.2.3.

Any news on when this will be committed? I was trying to use :finder_sql with interpolation today and thought that I was the crazy one. As it turns out this ticket and Ticket #3403 reported the issue a year ago.

06/26/07 22:58:52 changed by bitsweat

  • status changed from new to closed.
  • resolution set to untested.

And in that time, nobody has written a unit test. Please test the patch and reopen the ticket!

06/27/07 04:31:24 changed by acts_as_flinn

Ticket #7576 provides a patch and unit test for this bug. I just tested that patch against edge (REVISION_7136) and all test pass.

06/27/07 08:48:47 changed by bitsweat

  • status changed from closed to reopened.
  • resolution deleted.

06/27/07 08:48:58 changed by bitsweat

  • status changed from reopened to closed.
  • resolution set to duplicate.