From f3741506981d8d4aafb28066f5a3a0509a4da846 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 27 Dec 2009 00:11:31 +0530 Subject: Ensure Model.scoped adds type conditions for STI models --- activerecord/lib/active_record/named_scope.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/named_scope.rb') diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 38d54fa8ec..96d361093f 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -28,6 +28,7 @@ module ActiveRecord else if !scoped?(:find) relation = arel_table + relation = relation.where(type_condition) if finder_needs_type_condition? else relation = construct_finder_arel include_associations = scope(:find, :include) -- cgit v1.2.3