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

Suppress changes after creating with bitemporal_id #144

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wata727
Copy link
Contributor

@wata727 wata727 commented Aug 2, 2023

Currently, creating a record with bitemporal_id unintentionally has changes.

employee = Employee.create!(bitemporal_id: "a45296d3-ee21-4d3f-9235-ba2b3e679216")
employee.swapped_id # => "f77b261b-3bf2-45e3-891f-b35a25e0787d",

employee.changes
# => {"id"=>["f77b261b-3bf2-45e3-891f-b35a25e0787d", "a45296d3-ee21-4d3f-9235-ba2b3e679216"]}

This can cause unintended updates in autosave.

This PR removes without_clear_changes_information in swap_id! and makes it to always clear changes. This option seems to have been introduced in #37, but I couldn't understand from the PR why this was needed. Probably not needed.

@auto-assign auto-assign bot requested review from mkmn and motsat August 2, 2023 09:58
@wata727
Copy link
Contributor Author

wata727 commented Oct 10, 2023

This PR is frozen because #147 will suppress the unintended changes with performance improvements.

@wata727 wata727 marked this pull request as draft October 10, 2023 10:35
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.

3 participants