In yesterday's post I said, in relation to "how does .present? work on ActiveRecord::Relation", I said that present?
performs an existence check SELECT 1 AS one FROM ... LIMIT 1
because it calls exists?
underneath. This is actually wrong - it load
s the relation.
Jonathan Mast corrected me on Twitter. It turns out, I should have paid closer attention! Here is the actual implementation of blank?
on ActiveRecord::Relation on Rails master:
# Returns true if relation is blank.
def blank?
records.blank?
end