Permalink
Browse files

Merge pull request #5461 from yakko/master

relation .present? and .blank? should not query SELECT COUNT(DISTINCT id)
  • Loading branch information...
2 parents e61e0c0 + 9d52b45 commit fa7a3aaac734da7efef17039a934154f64144796 @josevalim josevalim committed Mar 16, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 activerecord/lib/active_record/relation.rb
@@ -507,6 +507,10 @@ def with_default_scope #:nodoc:
end
end
+ def blank?
+ to_a.blank?
+ end
+
private
def references_eager_loaded_tables?

0 comments on commit fa7a3aa

Please sign in to comment.