arel can escape the id, so avoid using the database connection

This commit is contained in:
Aaron Patterson
2010-12-22 19:20:08 -08:00
parent 83ffb82fb9
commit c7f81f14df

View File

@@ -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)