lib/hubspot/helpers/get_all_helper.rb in hubspot-api-client-16.3.0 vs lib/hubspot/helpers/get_all_helper.rb in hubspot-api-client-16.4.0
- old
+ new
@@ -10,11 +10,12 @@
# @option opts [Boolean] :archived Whether to return only results that have been archived. (default to false)
# @return Array
def get_all(opts = {})
after = nil
objects = []
+ opts[:limit] ||= MAX_PAGE_SIZE
loop do
- page_opts = opts.merge(limit: MAX_PAGE_SIZE, after: after)
+ page_opts = opts.merge(after: after)
page = get_page(page_opts)
objects.concat(page.results)
break objects if page.paging.nil?
after = page.paging._next.after
\ No newline at end of file