Skip to content

Commit

Permalink
Merge pull request rails#5461 from yakko/master
Browse files Browse the repository at this point in the history
relation .present? and .blank? should not query SELECT COUNT(DISTINCT id)
  • Loading branch information
josevalim committed Mar 16, 2012
2 parents e61e0c0 + 9d52b45 commit fa7a3aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activerecord/lib/active_record/relation.rb
Expand Up @@ -507,6 +507,10 @@ def with_default_scope #:nodoc:
end
end

def blank?
to_a.blank?
end

private

def references_eager_loaded_tables?
Expand Down

0 comments on commit fa7a3aa

Please sign in to comment.