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
@@ -3,7 +3,7 @@
3
3
  "velocious": "build/bin/velocious.js"
4
4
  },
5
5
  "name": "velocious",
6
- "version": "1.0.555",
6
+ "version": "1.0.556",
7
7
  "main": "build/index.js",
8
8
  "types": "build/index.d.ts",
9
9
  "files": [
@@ -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),