lib/zendesk_api/collection.rb in zendesk_api-1.6.3 vs lib/zendesk_api/collection.rb in zendesk_api-1.7.0

- old
+ new

@@ -318,21 +318,21 @@ raise(ArgumentError, "must pass a block") unless block page(start_page) clear_cache - while (bang ? fetch! : fetch) && !empty? + while (bang ? fetch! : fetch) each do |resource| arguments = [resource, @options["page"] || 1] if block.arity >= 0 arguments = arguments.take(block.arity) end block.call(*arguments) end - self.next + last_page? ? break : self.next end page(nil) clear_cache end