Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove nanoseconds when touching updated at (#415)
* Remove nanoseconds when touching created and updated at When you update a model, the `updated_at` field contains nanoseconds. But these nanoseconds are not stored in the database. So when you fetch the model again from the database does not contain the nanoseconds. This can lead to weird situations for clients. For example, a iOS app sends a PUT request to update a certain model and stores the result. The `updated_at` field is `2019-07-20T10:36:19.819375Z`. Later, when re-fetching the result from the API it returns a different response (because the `updated_at` field is now `2019-07-20T10:36:19Z`). This leads to weird situations. Also, Swift doesn't understand the nanoseconds. * Use time.Truncate instead of time.Unix trick
- Loading branch information