Skip to content

Commit

Permalink
Add fix in code of block model
Browse files Browse the repository at this point in the history
  • Loading branch information
tormozz48 committed Mar 23, 2015
1 parent e3be38b commit ea0c642
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/model/nodes/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ BlockNode.prototype.createMeta = function (version) {

BlockNode.prototype.saveToDb = function () {
var dataValue = this.source.data,
dataKey = util.format('blocks:data:%s', sha(JSON.stringify(dataValue))),
jsdocValue = this.source.jsdoc,
jsdocKey = util.format('blocks:jsdoc:%s', sha(JSON.stringify(jsdocValue))),
dataKey,
jsdocKey,
batchOperations = [];

if (dataValue) {
dataKey = util.format('blocks:data:%s', sha(JSON.stringify(dataValue)))
}

if (jsdocValue) {
jsdocKey = util.format('blocks:jsdoc:%s', sha(JSON.stringify(jsdocValue)))
}

if (this.source.data) {
batchOperations.push({
type: 'put',
Expand Down

0 comments on commit ea0c642

Please sign in to comment.