instance method
none?
Ruby on Rails edge
Since v5.0.7.2Signature
none?(*args)
Returns true if there are no records.
When an argument is given, returns true if no records match the argument via the case-equality operator (===).
posts.none?(Post) # => true if posts is empty
posts.none?(Comment) # => true
Parameters
-
argsrest
Source
# File activerecord/lib/active_record/relation.rb, line 390
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 390
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation