Ticket #11545: named_scopes_with_finder_sql_failing_test.diff
| File named_scopes_with_finder_sql_failing_test.diff, 1.4 kB (added by Henrik N, 6 months ago) |
|---|
-
rails/activerecord/test/models/author.rb
old new 1 1 class Author < ActiveRecord::Base 2 2 has_many :posts 3 has_many :posts_with_finder_sql, :class_name => "Post", :finder_sql => 'SELECT * FROM posts WHERE author_id = #{id}' 3 4 has_many :posts_with_comments, :include => :comments, :class_name => "Post" 4 5 has_many :posts_with_categories, :include => :categories, :class_name => "Post" 5 6 has_many :posts_with_comments_and_categories, :include => [ :comments, :categories ], :order => "posts.id", :class_name => "Post" -
rails/activerecord/test/cases/named_scope_test.rb
old new 112 112 113 113 assert_equal Topic.find(:all, scope), Topic.scoped(scope) 114 114 end 115 116 def test_finder_sql 117 # Sanity check 118 assert_equal authors(:david).posts, authors(:david).posts_with_finder_sql 119 # Currently fails: the latter returns nil 120 assert_equal authors(:david).posts.containing_the_letter_a, 121 authors(:david).posts_with_finder_sql.containing_the_letter_a 122 end 123 115 124 end