Method: ActiveModel::Datastore::ClassMethods#find_all_entities

Defined in:
lib/active_model/datastore.rb

#find_all_entities(ids_or_names, parent) ⇒ Object

Finds entities by keys using the provided array items. Results provided by the dataset ‘find_all` is a Dataset::LookupResults object.

Parameters:

  • ids_or_names (Array<Integer>, Array<String>)

    An array of ids or names.

[View source]

491
492
493
494
495
# File 'lib/active_model/datastore.rb', line 491

def find_all_entities(ids_or_names, parent)
  keys = ids_or_names.map { |id| CloudDatastore.dataset.key name, id }
  keys.map { |key| key.parent = parent } if parent.present?
  retry_on_exception { CloudDatastore.dataset.find_all keys }
end