This project is archived and is in readonly mode.
Condition Hashes through Joins Gives Fails when Circular References are Used
-
Ben Woodcroft
Sorry, to clarify, the github link is to the one where the feature was introduced, not the one to where the attached rails app was updated. That is 26 July 2008 or thereabouts
http://github.com/rails/rails/co...
Thanks,
ben
-
Pratik
- State changed from new to invalid
You should look at the query generated by Book.all(:joins => {:bookshelf => :books}) and use whatever the alias AR uses for books table.
:conditions => {:books_alias_or_table_name => {:title => 'book1'}}
-
Ben Woodcroft
But not having to look/remember/change it when rails does was the coolest thing about your patch..
Looks like I've confused myself slightly - I thought you had to specify the whole path to the table from the original via the joins.
It would be nice if the conditions and joins were somehow merged into one hash - that way there would be no confusion about the table the conditions were specified on.