aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-07 16:05:29 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-07 16:05:29 -0700
commit426ae869fe85462f5592fb225b431144804e25af (patch)
tree88ae2adeab00c35156e5797fc39de8688e15f9fe /activerecord
parent347d74a03b137ab2e501c710c951a8b059df05ba (diff)
downloadrails-426ae869fe85462f5592fb225b431144804e25af.tar.gz
rails-426ae869fe85462f5592fb225b431144804e25af.tar.bz2
rails-426ae869fe85462f5592fb225b431144804e25af.zip
where_values should extract the value of the Casted node
makes adequaterecord work with arel master.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation.rb8
1 files changed, 7 insertions, 1 deletions
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