Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename creation and modification properties to crate and mdate

  • Loading branch information...
commit df5bcf6e66aae4fe71d602ed750ab1b6d567f5dc 1 parent 5a23686
@wdavidw authored
Showing with 11 additions and 11 deletions.
  1. +5 −5 lib/Schema.coffee
  2. +6 −6 test/schema_temporal.coffee
View
10 lib/Schema.coffee
@@ -207,21 +207,21 @@ module.exports = class Schema
---------------------
Define or retrieve temporal definition. Marking a schema as
temporal will transparently add two new date properties, the
- date when the record was created (by default "creation"), and the date
- when the record was last updated (by default "modification").
+ date when the record was created (by default "cdate"), and the date
+ when the record was last updated (by default "mdate").
###
temporal: (temporal) ->
if temporal?
if temporal is true
temporal =
- creation: 'creation'
- modification: 'modification'
+ creation: 'cdate'
+ modification: 'mdate'
@data.temporal = temporal
@property temporal.creation, type: 'date'
@property temporal.modification, type: 'date'
else
- [ @data.temporal.creation, @data.temporal. modification ]
+ [ @data.temporal.creation, @data.temporal.modification ]
###
`unique([property])`
View
12 test/schema_temporal.coffee
@@ -26,8 +26,8 @@ describe 'type', ->
Records.clear (err) ->
Records.create {}, (err, record) ->
should.not.exist err
- record.creation.should.be.an.instanceof Date
- record.modification.should.be.an.instanceof Date
+ record.cdate.should.be.an.instanceof Date
+ record.mdate.should.be.an.instanceof Date
next()
it 'should deal with update', (next) ->
@@ -39,10 +39,10 @@ describe 'type', ->
date = new Date Date.UTC 2008, 8, 10, 16, 5, 10
Records.clear (err) ->
Records.create {}, (err, record) ->
- creation = record.creation
+ cdate = record.cdate
Records.update record, (err, record) ->
should.not.exist err
- record.creation.should.be.an.instanceof Date
- record.creation.should.eql creation
- record.modification.should.be.an.instanceof Date
+ record.cdate.should.be.an.instanceof Date
+ record.cdate.should.eql cdate
+ record.mdate.should.be.an.instanceof Date
next()
Please sign in to comment.
Something went wrong with that request. Please try again.