From 118147af53bebf71bf2a1d3ded4fc6491a708697 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Fri, 10 May 2013 20:57:12 +0200 Subject: Rather than raising ThrowResult when construct_limited_ids_conditions comes up empty, set the relation to NullRelation and rely on its results. This will help avoid errors like 2fcafee250ee2, because in most cases NullRelation will do the right thing. Minor bonus is avoiding the use of exceptions for flow control. --- activerecord/lib/active_record/errors.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/errors.rb') diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index cd31147414..34bfad2d62 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -69,10 +69,6 @@ module ActiveRecord end end - # Raised when SQL statement is invalid and the application gets a blank result. - class ThrowResult < ActiveRecordError - end - # Defunct wrapper class kept for compatibility. # +StatementInvalid+ wraps the original exception now. class WrappedDatabaseException < StatementInvalid -- cgit v1.2.3