class method
self.locate_many_signed
Ruby on Rails 1.1.0
Last seen in v1.3.0Signature
self.locate_many_signed(sgids, options = {})
Takes an array of SignedGlobalIDs or strings that can be turned into a SignedGlobalIDs. The SignedGlobalIDs are located using Model.find(array_of_ids), so the models must respond to that finder signature.
This approach will efficiently call only one #find per model class, but still interpolate the results to match the order in which the gids were passed.
Options:
-
:only- A class, module or Array of classes and/or modules that are allowed to be located. Passing one or more classes limits instances of returned classes to those classes or their subclasses. Passing one or more modules in limits instances of returned classes to those including that module. If no classes or modules match,nilis returned.
Parameters
-
sgidsreq -
optionsopt = {}
Source
# File lib/global_id/locator.rb, line 74
def locate_many_signed(sgids, options = {})
locate_many sgids.collect { |sgid| SignedGlobalID.parse(sgid, options.slice(:for)) }.compact, options
end
Defined in lib/global_id/locator.rb line 74
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in GlobalID::Locator