Permalink
Browse files

fix revision from history

  • Loading branch information...
1 parent 7247d4a commit 00b84472186de5aaa1c48af237d169d89323e598 Adriano Raiano committed Dec 5, 2012
Showing with 5 additions and 1 deletion.
  1. +4 −0 lib/bases/aggregateBase.js
  2. +1 −1 package.json
View
4 lib/bases/aggregateBase.js
@@ -71,6 +71,10 @@ Aggregate.prototype = {
_.each(historyEvents, function(evt) {
self[evt.event](evt.payload);
+
+ if (self.attributes.revision < evt.head.revision) {
+ self.attributes.revision = evt.head.revision;
+ }
});
this.previousAttributes = this.toJSON();
View
2 package.json
@@ -1,7 +1,7 @@
{
"author": "adrai",
"name": "cqrs-domain",
- "version": "0.3.3",
+ "version": "0.3.4",
"private": false,
"main": "index.js",
"engines": {

0 comments on commit 00b8447

Please sign in to comment.