Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added updatedAt

  • Loading branch information...
commit 583b95a800996ea0bc1bdf5229ab2272dc96bf5a 1 parent be94ef7
Anatoliy Chakkaev authored
5  app/models/chapter.js
@@ -6,3 +6,8 @@ Chapter.prototype.toString = function () {
6 6
     return this.title;
7 7
 };
8 8
 
  9
+Chapter.beforeUpdate = function (done, obj) {
  10
+    obj.updatedAt = new Date;
  11
+    done();
  12
+};
  13
+
4  config/database.json
... ...
@@ -1,5 +1,7 @@
1 1
 { "development":
2  
-  { "driver":   "redis"
  2
+  { "driver":   "mysql"
  3
+  , "database": "myapp_test"
  4
+  , "username": "root"
3 5
   }
4 6
 , "test":
5 7
   { "driver":   "memory"
1  db/schema.js
@@ -10,5 +10,6 @@ var Book = describe('Book', function () {
10 10
 
11 11
 var Chapter = describe('Chapter', function () {
12 12
     property('title', String);
  13
+    property('updatedAt', Date);
13 14
 });
14 15
 

0 notes on commit 583b95a

Please sign in to comment.
Something went wrong with that request. Please try again.