instance method
empty?
Ruby on Rails 7.2.3
Since v3.0.20Signature
empty?()
Returns true if there are no records.
Source
# File activerecord/lib/active_record/relation.rb, line 365
def empty?
return true if @none
if loaded?
records.empty?
else
!exists?
end
end
Defined in activerecord/lib/active_record/relation.rb line 365
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation