Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add published_at to post model fixtures #8573

Conversation

aileen
Copy link
Member

@aileen aileen commented Jun 13, 2017

closes #8562

Before we create our model fixtures, we assign a published_at property with a difference of 1 second for each blog post, so the prev_post and next_post helper work correctly. This fixed also an issue, where the order of the fixtures wasn't correct.

Copy link
Member

@kevinansfield kevinansfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor naming change but otherwise everything looks good 👍

// are different, otherwise `prev_post` and `next_post` helpers won't workd with
// them.
if (model.name === 'Post') {
_.forEach(model.entries, function (post, key) {

This comment was marked as abuse.

This comment was marked as abuse.

closes TryGhost#8562

Before we create our model fixtures, we assign a `published_at` property with a difference of 1 second for each blog post, so the `prev_post` and `next_psot` helper work correctly. This fixed also an issue, where the order of the fixtures wasn't correct.
@aileen aileen force-pushed the 1.0.0-dev/fix-post-fixtures-published-date branch from b2c6c19 to c729981 Compare June 13, 2017 08:49
@aileen
Copy link
Member Author

aileen commented Jun 13, 2017

If the code seems ok, this is ready for merging! I tested it with sqlite and MySQL.

@kevinansfield kevinansfield merged commit 57f8367 into TryGhost:master Jun 13, 2017
// them.
if (model.name === 'Post') {
_.forEach(model.entries, function (post, index) {
post.published_at = moment().add(index, 'seconds');

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

aileen added a commit to aileen/Ghost that referenced this pull request Sep 13, 2017
no issue
follow-up from TryGhost#8573

Move the hack that creates `published_at` values from the migration fn to our fixture util.
kirrg001 pushed a commit that referenced this pull request Sep 19, 2017
no issue

- follow-up from #8573
- bove the hack that creates published_at values from the migration fn to our fixture util
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Previous and next posts not rendered for welcome posts
3 participants