diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 20:57:12 +0200 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 21:11:03 +0200 |
commit | 118147af53bebf71bf2a1d3ded4fc6491a708697 (patch) | |
tree | 891389917a81df7cd18c42a14a26b2aaa6dda24c /activerecord/lib/active_record/errors.rb | |
parent | a2e607e1055dcede27970ccd7f5b89a1ddee8c32 (diff) | |
download | rails-118147af53bebf71bf2a1d3ded4fc6491a708697.tar.gz rails-118147af53bebf71bf2a1d3ded4fc6491a708697.tar.bz2 rails-118147af53bebf71bf2a1d3ded4fc6491a708697.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record/errors.rb')
-rw-r--r-- | activerecord/lib/active_record/errors.rb | 4 |
1 files changed, 0 insertions, 4 deletions
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 |