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 model option for not synchronizing timestamps #1416

Conversation

SebRollen
Copy link
Contributor

@SebRollen SebRollen commented Jan 19, 2023

Thank you for your contribution!

Check the following boxes:

  • Wrote good commit messages.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new
    code introduces user-observable changes.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

Message:
Paper trail automatically synchronizes the version
created_at timestamp to be the same as the updated_at
timestamp of the record being updated. This pull-requests
adds a configurable model-level option to disable this
behavior and instead have created_at be populated with
the timestamp when the version was inserted into the database.

The default remains to synchronize version timestamps

Fixes #1377

@SebRollen SebRollen force-pushed the sr-add-option-for-not-synchronizing-timestamps branch from 03c9b52 to dbbcc34 Compare January 19, 2023 22:24
Paper trail automatically synchronizes the version
created_at timestamp to be the same as the updated_at
timestamp of the record being updated. This pull-requests
adds a configurable model-level option to disable this
behavior and instead have created_at be populated with
the timestamp when the version was inserted into the database.

The default remains to synchronize version timestamps
@SebRollen SebRollen force-pushed the sr-add-option-for-not-synchronizing-timestamps branch 2 times, most recently from 396eaaa to c098f51 Compare January 19, 2023 23:00
@SebRollen SebRollen force-pushed the sr-add-option-for-not-synchronizing-timestamps branch from c098f51 to 6df3dbd Compare January 20, 2023 14:07
@jaredbeck jaredbeck merged commit 1fe26c9 into paper-trail-gem:master Jan 30, 2023
@jaredbeck
Copy link
Member

Thanks Sebastian, nice work!

@SebRollen SebRollen deleted the sr-add-option-for-not-synchronizing-timestamps branch January 30, 2023 15:36
@jaredbeck
Copy link
Member

Released in 15.0.0

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.

Version.created_at does not reflect when the version was created
2 participants