aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-23 14:42:55 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-23 14:42:55 -0800
commit8e8fb8a4291cc288b1189338f0de643c409eb028 (patch)
treec8a1fc3bfaa41f2ba2836a59357a4215d39cffe4 /activerecord/lib
parentd33dcba72d19beffc4a359f2fb89659f24122e9a (diff)
downloadrails-8e8fb8a4291cc288b1189338f0de643c409eb028.tar.gz
rails-8e8fb8a4291cc288b1189338f0de643c409eb028.tar.bz2
rails-8e8fb8a4291cc288b1189338f0de643c409eb028.zip
just wrap as a sql literal
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index 7e2ce06dae..70d84619a1 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -26,8 +26,7 @@ module ActiveRecord
when Range, Arel::Relation
attribute.in(value)
when ActiveRecord::Base
- sanitized_id = attribute.class == Arel::Attributes::String ? value.id : value.quoted_id
- attribute.eq(sanitized_id)
+ attribute.eq(Arel.sql(value.quoted_id))
when Class
# FIXME: I think we need to deprecate this behavior
attribute.eq(value.name)