diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-13 11:50:42 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-13 11:50:42 -0800 |
commit | aec4aa1702753f29ae79787c743f6f047ad9a80d (patch) | |
tree | 3420e9b48f55ece11b4dd324227409f08b3f8fe8 /activerecord | |
parent | 9b5d603c5aaa91f1d7a67a014d3ac680ad07577f (diff) | |
download | rails-aec4aa1702753f29ae79787c743f6f047ad9a80d.tar.gz rails-aec4aa1702753f29ae79787c743f6f047ad9a80d.tar.bz2 rails-aec4aa1702753f29ae79787c743f6f047ad9a80d.zip |
check bind parameter uniqueness
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/association_scope_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/association_scope_test.rb b/activerecord/test/cases/associations/association_scope_test.rb index d38648202e..a5ae3cbb20 100644 --- a/activerecord/test/cases/associations/association_scope_test.rb +++ b/activerecord/test/cases/associations/association_scope_test.rb @@ -7,8 +7,13 @@ module ActiveRecord 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) + scope = association_scope.scope + binds = scope.bind_values.map(&:last) + wheres = scope.where_values.map(&:right).reject { |node| + Arel::Nodes::BindParam === node + } assert_equal wheres.uniq, wheres + assert_equal binds.uniq, binds end end end |