-
Notifications
You must be signed in to change notification settings - Fork 78
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
Removing specific versions from the histroy #103
Comments
Yep, I think that could be useful. Something like
Depends on the implementation. I suggest adding a DB-side function/procedure and call it to avoid race conditions, e.g.: update my_table set log_data = logidze_remove_version(log_data, version_number) where id = 1 |
Closing this for now. Probably, doing such tasks manually (i.e., in Ruby, smth like |
here is a helpful snippet, implementation of subject.with_lock do
raw_history = subject.read_attribute_before_type_cast(:log_data)
altered_history = remove_version raw_history, version
Logidze.without_logging do
subject.update_column(:log_data, altered_history)
end
end |
I am currently working on a way to clean up the history as I did not use the
without_logging
wisely in the past in regards to some maintenance tasks and now what to expose part of the history to users.My approach is to remove the specific version from the json and updating the number of the other versions.
Is this something that would make sense to added to the gem?
Are there any obvious issues with my approach?
The text was updated successfully, but these errors were encountered: