Commit ab98772 1 parent 5f3c7fe commit ab98772 Copy full SHA for ab98772
File tree 2 files changed +9
-19
lines changed
2 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,6 @@ module.exports = {
20
20
// want new controllers to be added again unless needed for query
21
21
// parameter handling.
22
22
'ember/no-controllers' : 'error' ,
23
- // Croodle is not compliant with some of the recommended rules yet.
24
- // We should refactor the code step by step and enable them as soon
25
- // as the code is compliant.
26
- 'ember/classic-decorator-no-classic-methods' : 'warn' ,
27
- 'ember/no-controller-access-in-routes' : 'warn' ,
28
- 'ember/no-observers' : 'warn' ,
29
- 'no-prototype-builtins' : 'warn' ,
30
23
} ,
31
24
overrides : [
32
25
// ts files
Original file line number Diff line number Diff line change @@ -25,21 +25,18 @@ export default RestSerializer.extend({
25
25
if ( key === 'id' ) {
26
26
// records id
27
27
jsonApiPayload . data . id = attrs . id ;
28
- } else if (
29
- belongsToAssociations . hasOwnProperty ( key ) ||
30
- hasManyAssociations . hasOwnProperty ( key )
31
- ) {
28
+ } else if ( key in belongsToAssociations || key in hasManyAssociations ) {
32
29
// relationship
33
- if ( ! jsonApiPayload . data . hasOwnProperty ( 'relationships' ) ) {
30
+ if ( ! ( 'relationships' in jsonApiPayload . data ) ) {
34
31
jsonApiPayload . data . relationships = { } ;
35
32
}
36
33
37
- let association = belongsToAssociations . hasOwnProperty ( key )
38
- ? belongsToAssociations [ key ]
39
- : hasManyAssociations [ key ] ;
40
- let associationType = belongsToAssociations . hasOwnProperty ( key )
41
- ? 'belongsTo'
42
- : 'hasMany' ;
34
+ let association =
35
+ key in belongsToAssociations
36
+ ? belongsToAssociations [ key ]
37
+ : hasManyAssociations [ key ] ;
38
+ let associationType =
39
+ key in belongsToAssociations ? 'belongsTo' : 'hasMany' ;
43
40
let associationModel = association . modelName ;
44
41
let relationshipObject = { } ;
45
42
@@ -64,7 +61,7 @@ export default RestSerializer.extend({
64
61
jsonApiPayload . data . relationships [ key ] = relationshipObject ;
65
62
} else {
66
63
// attribute
67
- if ( ! jsonApiPayload . data . hasOwnProperty ( 'attributes' ) ) {
64
+ if ( ! ( 'attributes' in jsonApiPayload . data ) ) {
68
65
jsonApiPayload . data . attributes = { } ;
69
66
}
70
67
You can’t perform that action at this time.
0 commit comments