-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
🐛 Add published_at
to post model fixtures
#8573
Conversation
There was a problem hiding this 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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
b2c6c19
to
c729981
Compare
If the code seems ok, this is ready for merging! I tested it with sqlite and MySQL. |
// 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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
no issue follow-up from TryGhost#8573 Move the hack that creates `published_at` values from the migration fn to our fixture util.
no issue - follow-up from #8573 - bove the hack that creates published_at values from the migration fn to our fixture util
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 theprev_post
andnext_post
helper work correctly. This fixed also an issue, where the order of the fixtures wasn't correct.