diff options
author | Thiago Almeida <tapgyn@gmail.com> | 2012-03-16 01:14:24 -0300 |
---|---|---|
committer | Thiago Almeida <tapgyn@gmail.com> | 2012-03-16 01:14:24 -0300 |
commit | 9d52b45a5b8ccf8744c1b05d70bd00831cb87526 (patch) | |
tree | 405b608fed3d4323d21c9e4f68d0558fa1da803e /activerecord | |
parent | e2b675131204504fc6a60ecc7ecb3279886e6316 (diff) | |
download | rails-9d52b45a5b8ccf8744c1b05d70bd00831cb87526.tar.gz rails-9d52b45a5b8ccf8744c1b05d70bd00831cb87526.tar.bz2 rails-9d52b45a5b8ccf8744c1b05d70bd00831cb87526.zip |
relation .present? and .blank? should not query SELECT COUNT(DISTINCT id)
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index 6f39708ec3..ae2dc6872a 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -507,6 +507,10 @@ module ActiveRecord end end + def blank? + to_a.blank? + end + private def references_eager_loaded_tables? |