File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ export function model(definition?: ModelDefinitionSyntax) {
67
67
* @param definition
68
68
* @returns {(target:any, key:string) }
69
69
*/
70
- export function property ( definition : Partial < PropertyDefinition > ) {
70
+ export function property ( definition ? : Partial < PropertyDefinition > ) {
71
71
return PropertyDecoratorFactory . createDecorator (
72
72
MODEL_PROPERTIES_KEY ,
73
- definition ,
73
+ Object . assign ( { } , definition ) ,
74
74
) ;
75
75
}
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ describe('model decorator', () => {
67
67
@belongsTo ( { target : 'Customer' } )
68
68
// TypeScript does not allow me to reference Customer here
69
69
customer : ICustomer ;
70
+
71
+ // Validates that property no longer requires a parameter
72
+ @property ( ) isShipped : boolean ;
70
73
}
71
74
72
75
@model ( )
@@ -112,6 +115,7 @@ describe('model decorator', () => {
112
115
} ,
113
116
} ) ;
114
117
expect ( meta . id ) . to . eql ( { type : 'string' , id : true , generated : true } ) ;
118
+ expect ( meta . isShipped ) . to . eql ( { type : Boolean } ) ;
115
119
} ) ;
116
120
117
121
it ( 'adds embedsOne metadata' , ( ) => {
You can’t perform that action at this time.
0 commit comments