Closed skukx closed 4 years ago
When calling user.really_destroy! the following error raises
user.really_destroy!
RuntimeError: Can't modify frozen hash
This is due to scramble_email_and_password method.
scramble_email_and_password
When really destroying the method, this callback attempts to save a record which is deleted.
See: https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L53
Place at the top of the method
def scramble_email_and_password return if destroyed? # Rest of code end
This way, if we're actually destroying the record. save won't get called.
save
When calling
user.really_destroy!
the following error raisesThis is due to
scramble_email_and_password
method.When really destroying the method, this callback attempts to save a record which is deleted.
See: https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L53
Solution:
Place at the top of the method
This way, if we're actually destroying the record.
save
won't get called.