You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**In Rails, an auto-expiry of 1 month is set by default.** You can alter that deal
77
-
in an initializer with:
76
+
**In Rails, an auto-expiry of 1 month is set by default.** You can alter that
77
+
default in an initializer with:
78
78
79
79
```ruby
80
80
# config/initializers/global_id.rb
@@ -165,19 +165,19 @@ Note the order is maintained in the returned results.
165
165
166
166
Either `GlobalID::Locator.locate` or `GlobalID::Locator.locate_many` supports a hash of options as second parameter. The supported options are:
167
167
168
-
*:includes - A Symbol, Array, Hash or combination of them
169
-
The same structure you would pass into a`includes` method of Active Record.
170
-
See [Active Record eager loading associations](https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations)
168
+
*`:includes` - A Symbol, Array, Hash or combination of them.
169
+
The same structure you would pass into an`includes` method of Active Record.
170
+
See [Active Record eager loading associations](https://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations).
171
171
If present, `locate` or `locate_many` will eager load all the relationships specified here.
172
-
Note: It only works if all the gids models have those relationships.
173
-
*:only - A class, module or Array of classes and/or modules that are
172
+
Note: It only works if all the GIDs Models have those relationships.
173
+
*`:only` - A class, module, or Array of classes and/or modules that are
174
174
allowed to be located. Passing one or more classes limits instances of returned
175
175
classes to those classes or their subclasses. Passing one or more modules in limits
176
176
instances of returned classes to those including that module. If no classes or
177
177
modules match, `nil` is returned.
178
-
*:ignore_missing (Only for `locate_many`) - By default, `locate_many` will call `#find` on the model to locate the
178
+
*`:ignore_missing` (Only for `locate_many`) - By default, `locate_many` will call `#find` on the model to locate the
179
179
ids extracted from the GIDs. In Active Record (and other data stores following the same pattern),
180
-
`#find` will raise an exception if a named ID can't be found. When you set this option to true,
180
+
`#find` will raise an exception if a named ID can't be found. When you set this option to `true`,
181
181
we will use `#where(id: ids)` instead, which does not raise on missing records.
182
182
183
183
### Custom App Locator
@@ -207,7 +207,7 @@ class BarLocator
207
207
end
208
208
```
209
209
210
-
After defining locators as above, URIs like "gid://foo/Person/1" and "gid://bar/Person/1" will now use the foo block locator and `BarLocator` respectively.
210
+
After defining locators as above, URIs like `gid://foo/Person/1` and `gid://bar/Person/1` will now use the foo block locator and `BarLocator` respectively.
211
211
Other apps will still keep using the default locator.
0 commit comments