Returns the size
of the collection calling size
on the target.
If the collection has been already loaded length
and size
are equivalent. If not and you are going to need the records anyway this
method will take
one less query. Otherwise size
is more efficient.
# File activerecord/lib/active_record/associations/collection_association.rb, line 314
def length
load_target.size
end