Sha256: 1184925b6b6e60c74976a901da40d0b58c0b882db67b3e26217b847d934eb187

Contents?: true

Size: 357 Bytes

Versions: 8

Compression:

Stored size: 357 Bytes

Contents

module PolyglotIos
  module Helper
    module Depaginate
      PER_PAGE = 100

      def depaginate_query(query)
        depaginated_array = []
        page = query.page(1).per(PER_PAGE).all
        until page.nil?
          depaginated_array += page
          page = page.pages.next
        end
        depaginated_array
      end
      
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ios_polyglot_cli-2.4.0 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.3.0 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.2.2 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.2.1 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.2.0 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.1.1 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.1.0 lib/ios_polyglot_cli/helpers/depaginate.rb
ios_polyglot_cli-2.0.1 lib/ios_polyglot_cli/helpers/depaginate.rb