File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
jsonapi-model/files/__root__/__path__ Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ To run the app in /tests/dummy use a proxy url for a live API
47
47
* ` ember test --server `
48
48
* ` ember test --server -m 'Unit | Mixin | service cache' `
49
49
* ` ember test --server --filter 'cacheUpdate' `
50
+ * ` npm run nodetest ` tests for blueprint, e.g. ` jsonapi-resource `
50
51
51
52
A good way to get to know more about how this addon works is to review the tests,
52
53
see source code for the unit tests: [ tests/unit] ( tests/unit ) .
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import Ember from 'ember';
2
2
import Resource from 'ember-jsonapi-resources/models/resource' ;
3
3
import { attr , hasOne , hasMany } from 'ember-jsonapi-resources/models/resource' ;
4
4
5
- let < %= classifiedModuleName % > = Resource . extend ( {
5
+ let < %= classifiedModuleName % > Model = Resource . extend ( {
6
6
type : '<%= resource %>' ,
7
7
service : Ember . inject . service ( '<%= resource %>' ) ,
8
8
9
9
< %= attrs % >
10
10
} ) ;
11
11
12
- < %= classifiedModuleName % > .reopenClass({
12
+ < %= classifiedModuleName % > Model .reopenClass({
13
13
14
14
getDefaults ( ) {
15
15
return {
@@ -18,4 +18,4 @@ let <%= classifiedModuleName %> = Resource.extend({
18
18
}
19
19
} ) ;
20
20
21
- export default < %= classifiedModuleName % > ;
21
+ export default < %= classifiedModuleName % > Model ;
Original file line number Diff line number Diff line change @@ -57,17 +57,21 @@ module.exports = {
57
57
var modelOptions = merge ( { } , options , {
58
58
entity : {
59
59
name : entityName ? inflection . singularize ( entityName ) : ''
60
- }
60
+ } ,
61
+ originBlueprintName : 'jsonapi-model'
61
62
} ) ;
62
63
63
64
var otherOptions = merge ( { } , options ) ;
64
-
65
- return Promise . all ( [
65
+ var promises = [
66
66
this . _processBlueprint ( type , 'jsonapi-model' , modelOptions ) ,
67
67
this . _processBlueprint ( type , 'jsonapi-adapter' , otherOptions ) ,
68
68
this . _processBlueprint ( type , 'jsonapi-serializer' , otherOptions ) ,
69
69
this . _processBlueprint ( type , 'jsonapi-service' , otherOptions ) ,
70
70
this . _processBlueprint ( type , 'jsonapi-initializer' , otherOptions )
71
- ] ) ;
71
+ ] ;
72
+ if ( ! ! options . project . pkg [ 'ember-addon' ] ) {
73
+ promies . push ( this . _processBlueprint ( type , 'addon-import' , modelOptions ) ) ;
74
+ }
75
+ return Promise . all ( promises ) ;
72
76
}
73
77
} ;
You can’t perform that action at this time.
0 commit comments