Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAbility to set custom createdAt/updatedAt on create #520
Conversation
tanner0101
reviewed
Jun 19, 2018
// set timestamps | ||
copy = model | ||
let now = Date() | ||
copy.fluentUpdatedAt = now |
This comment has been minimized.
This comment has been minimized.
tanner0101
Jun 19, 2018
Member
No reason to set the model's existing property on the copy, it will already be there. Just check here if fluentUpdatedAt
is nil before setting (same for fluentCreatedAt
)
MihaelIsaev
added some commits
Jun 19, 2018
ezfe
reviewed
Jun 19, 2018
var copy = model | ||
|
||
// set timestamps | ||
if Result.createdAtKey != nil || Result.createdAtKey != nil { |
This comment has been minimized.
This comment has been minimized.
ezfe
Jun 19, 2018
•
This looks like you meant
Result.createdAtKey != nil || Result.updatedAtKey != nil
This comment has been minimized.
This comment has been minimized.
MihaelIsaev
and others
added some commits
Jun 19, 2018
tanner0101
added this to the 3.0.0-rc.4 milestone
Jun 19, 2018
tanner0101
approved these changes
Jun 19, 2018
tanner0101
merged commit a821d46
into
vapor:master
Jun 19, 2018
0 of 5 checks passed
ci/circleci: linux
Your tests are queued behind your running builds
Details
ci/circleci: linux-mysql
Your tests are queued behind your running builds
Details
ci/circleci: linux-postgresql
Your tests are queued behind your running builds
Details
ci/circleci: linux-release
Your tests are queued behind your running builds
Details
ci/circleci: linux-sqlite
Your tests are queued behind your running builds
Details
This comment has been minimized.
This comment has been minimized.
penny-coin
commented
Jun 19, 2018
Hey @MihaelIsaev, you just merged a pull request, have a coin! You now have 51 coins. |
tanner0101
self-assigned this
Jun 19, 2018
tanner0101
added
the
enhancement
label
Jun 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
MihaelIsaev commentedJun 19, 2018
When I'm trying to seed my database I want to be able to set
createdAt
/updatedAt
fields with custom values.This commit allows to do that.