> I haven't tested the patch, but it aliases the table names in the SQL, > so it may fix the problems that 1562 addresses (hopefully someone else > can give a more definitive answer). I hope it does and it gets > included in Rails 1.1, that way I won't have to keep updating the 1562 > patch and associated plugin (which would probably be painful because > of the changes made between 1.0 and Edge).
Yes, this will fix that issue. I've used this on one of my apps and it worked almost flawlessly. I updated a fixed patch that fixes on other issue. Even though it aliases the table names, the STI where statements are using the table name, causing STI queries to fail. class Content < AR::Base end class Product < Content has_many :comments end class Comment < Content end Doing this gets me a query ending with: (contents.type = 'Product') and (contents.type = 'Comment') I fixed this to use table aliases, so now you get: (contents.type = 'Product') and (t1.type = 'Comment') However, this was leaving out otherwise valid products that have 0 comments. (contents.type = 'Product') and (t1.type = 'Comment' or t1.type IS NULL) This will get all products, and comments if they're available. I added a sample test case to prove this as well. This patch gets my vote. -- Rick Olson http://techno-weenie.net _______________________________________________ Rails-core mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-core
