0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Improvement for published posts with no published_at

issue #2015

- this is another little workaround / improvement to try to reduce the number of people who end up with a published post with no published_at set
- I assume we need to complete #1655 to fix this properly
This commit is contained in:
Hannah Wolfe 2014-01-26 12:05:27 +00:00
parent b0345b6238
commit 7049d0f338

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);