instance method
none?
Ruby on Rails 8.0.4
Since v5.2.8.1Signature
none?(*args)
Returns true if there are no records.
When a pattern argument is given, this method checks whether elements in the Enumerable match the pattern via the case-equality operator (===).
posts.none?(Comment) # => true or false
Parameters
-
argsrest
Source
# File activerecord/lib/active_record/relation.rb, line 388
def none?(*args)
return true if @none
return super if args.present? || block_given?
empty?
end
Defined in activerecord/lib/active_record/relation.rb line 388
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation