Ticket #11424: generate_valid_sql_on_deeply_nested_tables_and_association_limiting.diff
| File generate_valid_sql_on_deeply_nested_tables_and_association_limiting.diff, 1.6 kB (added by danger, 8 months ago) |
|---|
-
activerecord/test/cases/associations/cascaded_eager_loading_test.rb
old new 58 58 assert_equal companies(:first_firm).account, assert_no_queries { firms.first.account.firm.account } 59 59 assert_equal companies(:first_firm).account.firm.account, assert_no_queries { firms.first.account.firm.account } 60 60 end 61 62 def test_eager_association_loading_with_condition_on_cascaded_table_generates_valid_sql 63 assert_nothing_raised { Author.find(:all, :include => {:posts => :comments}, :conditions => "comments.body LIKE '%hello%'", :limit => 10) } 64 end 61 65 62 66 def test_eager_association_loading_with_has_many_sti 63 67 topics = Topic.find(:all, :include => :replies, :order => 'topics.id') -
activerecord/lib/active_record/associations.rb
old new 1437 1437 sql << " FROM #{connection.quote_table_name table_name} " 1438 1438 1439 1439 if is_distinct 1440 sql << join_dependency.join_associations. reject{ |ja| !all_tables.include?(ja.table_name) }.collect(&:association_join).join1440 sql << join_dependency.join_associations.collect(&:association_join).join 1441 1441 add_joins!(sql, options, scope) 1442 1442 end 1443 1443