From ace84a003cb48f60ca478c05c1fd8a57d37663cf Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 15 Nov 2010 20:24:58 -0800 Subject: support finding by a ruby class [#5979 state:resolved] --- activerecord/lib/active_record/relation/predicate_builder.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 2eda404490..32c7d08daa 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -27,6 +27,9 @@ module ActiveRecord attribute.in(value) when ActiveRecord::Base attribute.eq(value.quoted_id) + when Class + # FIXME: I think we need to deprecate this behavior + attribute.eq(value.name) else attribute.eq(value) end -- cgit v1.2.3