Skip to content

Commit 3ecb5e1

Browse files
authored
Merge pull request #2974 from strongloop/defaultValue
Remove workaround for default value
2 parents 80b0bb8 + f72a296 commit 3ecb5e1

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

common/models/access-token.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ var DEFAULT_TOKEN_LEN = 64;
3434
*/
3535

3636
module.exports = function(AccessToken) {
37-
// Workaround for https://github.com/strongloop/loopback/issues/292
38-
AccessToken.definition.rawProperties.created.default =
39-
AccessToken.definition.properties.created.default = function() {
40-
return new Date();
41-
};
42-
4337
/**
4438
* Anonymous Token
4539
*

common/models/access-token.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"description": "time to live in seconds (2 weeks by default)"
1313
},
1414
"created": {
15-
"type": "Date"
15+
"type": "Date",
16+
"defaultFn": "now"
1617
}
1718
},
1819
"relations": {

0 commit comments

Comments
 (0)