From ec852d62751b04398f5992d9b7b238694f59a56b Mon Sep 17 00:00:00 2001 From: tlloydthwaites <91047784+tlloydthwaites@users.noreply.github.com> Date: Mon, 29 May 2023 12:02:30 +1000 Subject: [PATCH 1/2] Update table.rb Make records() defer to select() --- lib/airtable/table.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/airtable/table.rb b/lib/airtable/table.rb index 82dc903..ebac364 100644 --- a/lib/airtable/table.rb +++ b/lib/airtable/table.rb @@ -22,10 +22,8 @@ def all(options={}) # Options: limit = 100, offset = "as345g", sort = ["Name", "asc"] # records(:sort => ["Name", :desc], :limit => 50, :offset => "as345g") def records(options={}) - options["sortField"], options["sortDirection"] = options.delete(:sort) if options[:sort] - results = self.class.get(worksheet_url, query: options).parsed_response - check_and_raise_error(results) - RecordSet.new(results) + # previous was just a limited version of select() + select(options) end # Query for records using a string formula From f2f7c3257ffd68d1b991c48ca173b88ea6db200d Mon Sep 17 00:00:00 2001 From: tlloydthwaites <91047784+tlloydthwaites@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:03:42 +1000 Subject: [PATCH 2/2] Update table.rb --- lib/airtable/table.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/airtable/table.rb b/lib/airtable/table.rb index ebac364..8240b22 100644 --- a/lib/airtable/table.rb +++ b/lib/airtable/table.rb @@ -1,16 +1,13 @@ module Airtable class Table < Resource - # Maximum results per request - LIMIT_MAX = 100 - # Fetch all records iterating through offsets until retrieving the entire collection # all(:sort => ["Name", :desc]) def all(options={}) offset = nil results = [] begin - options.merge!(:limit => LIMIT_MAX, :offset => offset) + options.merge!(:offset => offset) response = records(options) results += response.records offset = response.offset