From f1764a2de17bba07bad3ec0d88de152d8279d3bb Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 13 Jan 2014 16:15:20 -0800 Subject: unscope should remove bind values associated with the where --- activerecord/lib/active_record/relation/query_methods.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 827d108fd7..979216bee7 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -880,6 +880,8 @@ module ActiveRecord raise "unscope(where: #{target_value.inspect}) failed: unscoping #{rel.class} is unimplemented." end end + + bind_values.reject! { |col,_| col.name == target_value } end def custom_join_ast(table, joins) -- cgit v1.2.3