class method
self.locate
Ruby on Rails 1.1.0
Last seen in v1.3.0Signature
self.locate(gid, options = {})
Takes either a GlobalID or a string that can be turned into a GlobalID
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
-
gidreq -
optionsopt = {}
Source
# File lib/global_id/locator.rb, line 14
def locate(gid, options = {})
if gid = GlobalID.parse(gid)
locator_for(gid).locate gid if find_allowed?(gid.model_class, options[:only])
end
end
Defined in lib/global_id/locator.rb line 14
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in GlobalID::Locator