From 426ae869fe85462f5592fb225b431144804e25af Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 7 Apr 2014 16:05:29 -0700 Subject: where_values should extract the value of the Casted node makes adequaterecord work with arel master. --- activerecord/lib/active_record/relation.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 915035558c..0ad7c207b3 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -539,7 +539,13 @@ module ActiveRecord Hash[equalities.map { |where| name = where.left.name - [name, binds.fetch(name.to_s) { where.right }] + [name, binds.fetch(name.to_s) { + case where.right + when Array then where.right.map(&:val) + else + where.right.val + end + }] }] end -- cgit v1.2.3