aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-22 19:20:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-22 19:20:08 -0800
commitc7f81f14dfe02a2b3839b86d9fd47ce784aeeca6 (patch)
treedc55a7f53a831d005f01f6e7bf076bc993111243 /activerecord
parent83ffb82fb9f53e1c90d3b598067494a12258b605 (diff)
downloadrails-c7f81f14dfe02a2b3839b86d9fd47ce784aeeca6.tar.gz
rails-c7f81f14dfe02a2b3839b86d9fd47ce784aeeca6.tar.bz2
rails-c7f81f14dfe02a2b3839b86d9fd47ce784aeeca6.zip
arel can escape the id, so avoid using the database connection
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index 6760d65186..b3f1b9e36a 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -26,7 +26,7 @@ module ActiveRecord
when Range, Arel::Relation
attribute.in(value)
when ActiveRecord::Base
- attribute.eq(Arel.sql(value.quoted_id))
+ attribute.eq(value.id)
when Class
# FIXME: I think we need to deprecate this behavior
attribute.eq(value.name)