This project is archived and is in readonly mode.
JoinAssociation#aliased_table_name_for bug affecting AR find_with_associations?
-
Jeremy Kemper
- Milestone cleared.
- State changed from new to open
- Assigned user set to Pratik
Indeed! Tricky one; good diagnosis.
-
Pratik
@Ernie : Patch w/ tests please :)
-
Ernie Miller
Here you go!
-
Ernie Miller
- Tag changed from activerecord, eager_loading, find_with_associations to activerecord, eager_loading, find_with_associations, patch, tests
-
Ernie Miller
One small cleanup to patch and an updated test.
-
Ernie Miller
Optimized patch and found a bug in association counts with the old version.
-
Ernie Miller
- Tag changed from activerecord, eager_loading, find_with_associations, patch, tests to activerecord, eager_loading, find_with_associations, patch, tests, updated
-
Repository
- State changed from open to committed
(from [e33d304975f5b20b0ba819ab644a2a8f80ff3743]) Fix eager loading of associations causing table name collisions
[#4463 JoinAssociation#aliased_table_name_for bug affecting AR find_with_associations? state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/e33d304975f5b20b0ba819ab644a2a... -
Ernie Miller
Made a silly mistake in the previous patch, checking is_a? instead of class equality. Since JoinAssociation inherits from JoinBase, this can cause a stashed association join to be grafted onto the JoinBase instead of a JoinAssociation in the edge case of multiple-self-joining eager loads. Patch with test included. Sorry about that!
-
Ernie Miller
- Tag changed from activerecord, eager_loading, find_with_associations, patch, tests, updated to activerecord, eager_loading, find_with_associations, fixed, patch, tests, updated, updated_again
