Merge pull request #2038 from ErisDS/issue-2015

Improvement for published posts with no published_at
This commit is contained in:
Hannah Wolfe 2014-01-26 08:09:26 -08:00
commit 6efc8ffed2

View File

@ -61,6 +61,9 @@ Post = ghostBookshelf.Model.extend({
}
// This will need to go elsewhere in the API layer.
this.set('published_by', 1);
} else if (this.get('status') === 'published' && !this.get('published_at')) {
// If somehow this is a published post with no date, fix it... see #2015
this.set('published_at', new Date());
}
ghostBookshelf.Model.prototype.saving.call(this);