From 3968825f5ff6a75cb83400716d56ec10f261e41a Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 16 Jan 2010 23:11:35 +0530 Subject: Make sure Model#active_relation always adds STI conditions if needed --- activerecord/lib/active_record/calculations.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/calculations.rb') diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb index a79ceb1d05..ed4218807d 100644 --- a/activerecord/lib/active_record/calculations.rb +++ b/activerecord/lib/active_record/calculations.rb @@ -167,8 +167,6 @@ module ActiveRecord if merge_with_relation relation = merge_with_relation.except(:select, :order, :limit, :offset, :group, :from).merge(relation) - else - relation = relation.where(type_condition) if finder_needs_type_condition? end from = merge_with_relation.from_value if merge_with_relation && merge_with_relation.from_value.present? @@ -194,8 +192,6 @@ module ActiveRecord relation.where_values = merge_with_relation.where_values merge_limit = merge_with_relation.taken - else - relation = relation.where(type_condition) if finder_needs_type_condition? end relation = relation.apply_finder_options(options.slice(:joins, :group, :having, :order, :conditions, :from)). -- cgit v1.2.3