This method is only available on newer versions. The first available version (v8.1.1) is shown here.
size()
Number of elements in the queue.
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb, line 66 def size synchronize do @queue.size end end