Changeset 8270
- Timestamp:
- 12/05/07 02:30:30 (5 months ago)
- Files:
-
- 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/lib/active_record/associations.rb
r8126 r8270 1248 1248 def construct_finder_sql_with_included_associations(options, join_dependency) 1249 1249 scope = scope(:find) 1250 sql = "SELECT #{column_aliases(join_dependency)} FROM #{ connection.quote_table_name((scope && scope[:from]) || options[:from] || table_name)} "1250 sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} " 1251 1251 sql << join_dependency.join_associations.collect{|join| join.association_join }.join 1252 1252 trunk/activerecord/test/associations/eager_test.rb
r8036 r8270 36 36 assert_equal posts(post), list[index] 37 37 end 38 end 39 40 def test_with_two_tables_in_from_without_getting_double_quoted 41 posts = Post.find(:all, 42 :select => "posts.*", 43 :from => "posts, authors", 44 :include => :comments, 45 :conditions => "posts.author_id = authors.id" 46 ) 47 48 assert_equal 2, posts.first.comments.size 38 49 end 39 50