Module: Airtable::ORM::Associations
Class Method Summary collapse
-
.fetch_linked_records(klass, ids) ⇒ Object
Fetch linked records via find_many, slicing to its per-request ID cap so an association (or preload union) with more links than the cap still loads.
Class Method Details
.fetch_linked_records(klass, ids) ⇒ Object
Fetch linked records via find_many, slicing to its per-request ID cap so an association (or preload union) with more links than the cap still loads.
10 11 12 13 14 |
# File 'lib/airtable/orm/associations.rb', line 10 def self.fetch_linked_records(klass, ids) records = ids.each_slice(Airtable::ORM::Persistence::MAX_FIND_MANY_IDS) .flat_map { |slice| klass.find_many(slice).to_a } Airtable::ORM::Collection.new(records, model_class: klass) end |