velocious 1.0.555 → 1.0.556
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2826,6 +2826,12 @@ export default class FrontendModelController extends Controller {
|
|
|
2826
2826
|
if (resourceClass) {
|
|
2827
2827
|
return new resourceClass({
|
|
2828
2828
|
ability: this.currentAbility(),
|
|
2829
|
+
// Propagate the controller so a related/preloaded model's serialization
|
|
2830
|
+
// resource can use request context (e.g. `requestBaseUrl()` for signed
|
|
2831
|
+
// download URLs). Without it, any `<attr>Attribute` method that reaches
|
|
2832
|
+
// for the controller throws "requires a controller instance." when a
|
|
2833
|
+
// relationship is serialized as a preload.
|
|
2834
|
+
controller: this,
|
|
2829
2835
|
context: this.currentAbility()?.getContext() || {},
|
|
2830
2836
|
locals: this.currentAbility()?.getLocals() || {},
|
|
2831
2837
|
modelClass: /** @type {typeof import("./database/record/index.js").default} */ (model.constructor),
|