Changeset 7494
- Timestamp:
- 09/15/07 23:50:12 (1 year ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations.rb (modified) (1 diff)
- trunk/activerecord/test/associations/eager_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r7492 r7494 1 1 *SVN* 2 3 * Eager loading respects explicit :joins. #9496 [dasil003] 2 4 3 5 * Extract Firebird, FronBase, and OpenBase adapters into gems. #9508, #9509, #9510 [Jeremy Kemper] trunk/activerecord/lib/active_record/associations.rb
r7402 r7494 1267 1267 def construct_finder_sql_for_association_limiting(options, join_dependency) 1268 1268 scope = scope(:find) 1269 is_distinct = include_eager_conditions?(options) || include_eager_order?(options)1269 is_distinct = !options[:joins].blank? || include_eager_conditions?(options) || include_eager_order?(options) 1270 1270 sql = "SELECT " 1271 1271 if is_distinct trunk/activerecord/test/associations/eager_test.rb
r7472 r7494 102 102 assert_equal 1, posts.length 103 103 assert_equal [2], posts.collect { |p| p.id } 104 end 105 106 def test_eager_association_loading_with_explicit_join 107 posts = Post.find(:all, :include => :comments, :joins => "INNER JOIN authors ON posts.author_id = authors.id AND authors.name = 'Mary'", :limit => 1, :order => 'author_id') 108 assert_equal 1, posts.length 104 109 end 105 110