File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
activerecord/lib/active_record Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,11 @@ def empty?
291
291
end
292
292
293
293
# Returns true if there are no records.
294
+ #
295
+ # When a pattern argument is given, this method checks whether elements in
296
+ # the Enumerable match the pattern via the case-equality operator (`===`).
297
+ #
298
+ # posts.none?(Comment) # => true or false
294
299
def none? ( *args )
295
300
return true if @none
296
301
@@ -299,6 +304,11 @@ def none?(*args)
299
304
end
300
305
301
306
# Returns true if there are any records.
307
+ #
308
+ # When a pattern argument is given, this method checks whether elements in
309
+ # the Enumerable match the pattern via the case-equality operator (`===`).
310
+ #
311
+ # posts.any?(Post) # => true or false
302
312
def any? ( *args )
303
313
return false if @none
304
314
@@ -307,6 +317,11 @@ def any?(*args)
307
317
end
308
318
309
319
# Returns true if there is exactly one record.
320
+ #
321
+ # When a pattern argument is given, this method checks whether elements in
322
+ # the Enumerable match the pattern via the case-equality operator (`===`).
323
+ #
324
+ # posts.one?(Post) # => true or false
310
325
def one? ( *args )
311
326
return false if @none
312
327
You can’t perform that action at this time.
0 commit comments