aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-14 14:20:07 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-14 14:20:07 -0800
commit8e6ef92fd9ede38aa435afeaef6370ff65191a0b (patch)
tree03dc053a579d5401a12498e9ea0716881b08bb0c /activerecord/test
parent3b675f05ffb11cdbfd3f7d416906ff16941e8367 (diff)
downloadrails-8e6ef92fd9ede38aa435afeaef6370ff65191a0b.tar.gz
rails-8e6ef92fd9ede38aa435afeaef6370ff65191a0b.tar.bz2
rails-8e6ef92fd9ede38aa435afeaef6370ff65191a0b.zip
pass the association and connection to the scope method
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/association_scope_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/association_scope_test.rb b/activerecord/test/cases/associations/association_scope_test.rb
index d38648202e..f9793277e5 100644
--- a/activerecord/test/cases/associations/association_scope_test.rb
+++ b/activerecord/test/cases/associations/association_scope_test.rb
@@ -6,8 +6,10 @@ module ActiveRecord
module Associations
class AssociationScopeTest < ActiveRecord::TestCase
test 'does not duplicate conditions' do
- association_scope = AssociationScope.new(Author.new.association(:welcome_posts))
- wheres = association_scope.scope.where_values.map(&:right)
+ association_scope = AssociationScope.new
+ scope = association_scope.scope(Author.new.association(:welcome_posts),
+ Author.connection)
+ wheres = scope.where_values.map(&:right)
assert_equal wheres.uniq, wheres
end
end