activerecord-bitemporal
activerecord-bitemporal copied to clipboard
Suppress changes after creating with bitemporal_id
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.
This PR is frozen because https://github.com/kufu/activerecord-bitemporal/pull/147 will suppress the unintended changes with performance improvements.