diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-13 16:15:20 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-13 16:15:20 -0800 |
commit | f1764a2de17bba07bad3ec0d88de152d8279d3bb (patch) | |
tree | bd1e766ed6b937405b86d31aff2a29bffc2ad203 /activerecord/test | |
parent | 1e2d7c2de2d28afbb2d5ee8b656fe7195b17ad74 (diff) | |
download | rails-f1764a2de17bba07bad3ec0d88de152d8279d3bb.tar.gz rails-f1764a2de17bba07bad3ec0d88de152d8279d3bb.tar.bz2 rails-f1764a2de17bba07bad3ec0d88de152d8279d3bb.zip |
unscope should remove bind values associated with the where
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 031da8e6d6..a0896f7f8d 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -1524,6 +1524,15 @@ class RelationTest < ActiveRecord::TestCase assert merged.to_sql.include?("bbq") end + def test_unscope_removes_binds + left = Post.where(id: Arel::Nodes::BindParam.new('?')) + column = Post.columns_hash['id'] + left.bind_values += [[column, 20]] + + relation = left.unscope(where: :id) + assert_equal [], relation.bind_values + end + def test_merging_removes_rhs_bind_parameters left = Post.where(id: Arel::Nodes::BindParam.new('?')) column = Post.columns_hash['id'] |