diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-10 18:03:41 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-10 22:05:38 -0300 |
commit | bbec883edb350cc9f75beea183e335b91a11e242 (patch) | |
tree | 5f8b3f1fd88cd65109c602fec94e54ed32b8769b /activerecord/lib/active_record | |
parent | 9e6eb8b648acf38474e46c335782c65d65b1a185 (diff) | |
download | rails-bbec883edb350cc9f75beea183e335b91a11e242.tar.gz rails-bbec883edb350cc9f75beea183e335b91a11e242.tar.bz2 rails-bbec883edb350cc9f75beea183e335b91a11e242.zip |
Merge pull request #6521 from Empact/throw-result
Fix that #exists? can blow up with ThrowResult exception
Conflicts:
activerecord/lib/active_record/relation/finder_methods.rb
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index fa457ae0c6..86f1d6936e 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -200,6 +200,8 @@ module ActiveRecord end connection.select_value(relation, "#{name} Exists") ? true : false + rescue ThrowResult + false end protected |