Browse files

just wrap as a sql literal

  • Loading branch information...
1 parent d67464a commit 60744d22cbda1c90bae9d237dadb404e84d5d1d3 @tenderlove tenderlove committed Nov 23, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/relation/predicate_builder.rb
View
3 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -31,8 +31,7 @@ def build_from_hash(attributes, default_table)
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)

0 comments on commit 60744d2

Please sign in to comment.