-
Notifications
You must be signed in to change notification settings - Fork 529
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
really_destroy! updates column with datetime even when using sentinel_value #326
Comments
I have same issue with rails 5.0.0.1 and ruby 2.3.1.
Because of i write |
steverice
added a commit
to steverice/paranoia
that referenced
this issue
Jul 13, 2017
This removes the assumption from `really_destroy!` that there is only one column value, the deletion date, that needs to be updated on a model that is being `really_destroy!`ed. Instead, use the defined `paranoia_destroy_attributes` as they are used in `destroy` and other calls. This prevents an issue where the DBMS will complain when trying to `really_destroy!` one of these models, given that paranoia is attempting to insert a DateTime value into a boolean (or otherly- typed) column. Fixes rubysherpas#326
karunkumar1ly
pushed a commit
to edcast/paranoia
that referenced
this issue
Feb 6, 2024
This removes the assumption from `really_destroy!` that there is only one column value, the deletion date, that needs to be updated on a model that is being `really_destroy!`ed. Instead, use the defined `paranoia_destroy_attributes` as they are used in `destroy` and other calls. This prevents an issue where the DBMS will complain when trying to `really_destroy!` one of these models, given that paranoia is attempting to insert a DateTime value into a boolean (or otherly- typed) column. Fixes rubysherpas#326
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using paranoia 2.1.5, I have a model setup using the
sentinel_value
option, as documented in the README under "Indexes", e.g:When calling
really_destroy!
on this model the following warning is generated by Rails (4.2.6):This is because paranoia is writing the current datetime into the paranoia column (
active
in this example), at this line: https://github.com/rubysherpas/paranoia/blob/core/lib/paranoia.rb#L146. I think this should probably useparanoia_destroy_attributes
instead?However it's not clear to me why it is even updating the column if it then goes and deletes the row from the database? Why update the column at all?
The text was updated successfully, but these errors were encountered: