activerecord-bitemporal icon indicating copy to clipboard operation
activerecord-bitemporal copied to clipboard

Suppress changes after creating with bitemporal_id

Open wata727 opened this issue 2 years ago • 1 comments

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.

wata727 avatar Aug 02 '23 09:08 wata727

This PR is frozen because https://github.com/kufu/activerecord-bitemporal/pull/147 will suppress the unintended changes with performance improvements.

wata727 avatar Oct 10 '23 05:10 wata727