MCPcopy Create free account
hub / github.com/ember-learn/ember-api-docs / model

Method model

app/routes/project-version/modules/module.js:8–33  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

6 @service store;
7
8 async model(params) {
9 const { project, project_version: compactVersion } =
10 this.paramsFor('project-version');
11
12 let projectObj = await this.store.findRecord('project', project);
13 let projectVersion = getFullVersion(
14 compactVersion,
15 project,
16 projectObj,
17 this.metaStore,
18 );
19 let klass = params['module'];
20
21 // These modules should not have `ember-` tacked onto the front of them
22 // when forming the ids and URLs.
23 let isNotEmber = klass.match(/@warp-drive|@glimmer|rsvp|jquery/);
24
25 if (!~klass.indexOf(project) && !isNotEmber) {
26 klass = `${project}-${klass}`;
27 }
28
29 return this.find(
30 'module',
31 `${project}-${projectVersion}-${klass}`.toLowerCase(),
32 );
33 }
34
35 serialize(model) {
36 return {

Callers

nothing calls this directly

Calls 3

getFullVersionFunction · 0.85
findRecordMethod · 0.80
findMethod · 0.80

Tested by

no test coverage detected