instance method
any?
Ruby on Rails 4.2.9
Since v3.0.20Signature
any?()
Returns true if there are any records.
Source
# File activerecord/lib/active_record/relation.rb, line 273
def any?
if block_given?
to_a.any? { |*block_args| yield(*block_args) }
else
!empty?
end
end
Defined in activerecord/lib/active_record/relation.rb line 273
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation