diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-23 14:58:10 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-23 14:33:00 -0800 |
commit | d33dcba72d19beffc4a359f2fb89659f24122e9a (patch) | |
tree | 1f72b6c88a6714ecc9fe9ac90cad5bd4ee0b65c8 /activerecord/lib/active_record/relation/predicate_builder.rb | |
parent | 0456feab1198456069d4b5a9da221e6fd818e3da (diff) | |
download | rails-d33dcba72d19beffc4a359f2fb89659f24122e9a.tar.gz rails-d33dcba72d19beffc4a359f2fb89659f24122e9a.tar.bz2 rails-d33dcba72d19beffc4a359f2fb89659f24122e9a.zip |
Do not send id for quoting twice if the primary key is string.
[#6022 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record/relation/predicate_builder.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 32c7d08daa..7e2ce06dae 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -26,7 +26,8 @@ module ActiveRecord when Range, Arel::Relation attribute.in(value) when ActiveRecord::Base - attribute.eq(value.quoted_id) + sanitized_id = attribute.class == Arel::Attributes::String ? value.id : value.quoted_id + attribute.eq(sanitized_id) when Class # FIXME: I think we need to deprecate this behavior attribute.eq(value.name) |