Closed
Description
In the latest release, this method was updated to be smarter and only load the count instead of all the records. But, the case of passing args/block to this method was missed and breaks that functionality. It should now check if args/block has been passed in, and if so then call super and use normal functionality; otherwise use the optimized way of check if the count is positive:
module ReactiveRecord
class Collection
def any?(*args, &block)
# If we are doing anything other than just checking if there is an object in the collection,
# proceed to the normal behavior
return super if args&.length&.positive? || block.present?
# Otherwise just check the count for efficiency
count.positive?
end
end
end
Metadata
Metadata
Assignees
Labels
No labels