Closed jtapia closed 1 year ago
Thanks for creating this issue. The context is really helpful.
As I mentioned in the original PR over here, this issue is presumably caused by the load order causing the SoftDeletable
concern not to be available when the Spree::User
model is reloaded, causing it to attempt to use the pre-SoftDeletable
paranoia code path, and blowing up.
My assumption is currently that we need to do something to ensure that the module is available, but if we're at the point where we (@solidusio/core-team) are happy to remove paranoia support fully from solidus_auth_devise, we could go the route that you came up with in #223.
Hello @jtapia @jarednorman ! I'm not sure if there is still a need to reproduce the issue encountered here, but just the same, I tried it out, and I haven't been successful so far :) Please watch the video below of my test run:
https://user-images.githubusercontent.com/61476/181177137-6ffd4264-2a4f-439c-959a-b44778540f69.mp4
You can find the test app at https://github.com/gsmendoza/rails_6141_store/tree/solidus_auth_devise_225.
As I said in the video, if you have any suggestions on how I can update the app to reproduce the issue, please let me know. Thanks!
I wonder if there's a reference to the user model somewhere in the apps of the people hitting this issue that's changing the order the classes get loaded or something.
I re-visited this today, we had made a fork and removed that code which was causing us issues for the time being. This issue stopped presenting itself... I'm not really sure what was going on with the load order which was appearing to make this go wrong but I think it's safe to close this issue.
I found that upgrading from the classic autoloader to Zeitwerk fixed this issue for me.
Going to close this, if it happens again, feel free to comment!
Adding this require
to the top of my application.rb
also fixed this without having to upgrade to zeitwerk
gem_dir = Gem::Specification.find_by_name("solidus_core").gem_dir
require "#{gem_dir}/app/models/concerns/spree/soft_deletable"
Description
We upgraded
Solidus
from2.11
to3.1.0
and we have an user model decorator, after the upgrade we started noticiting that if change and reload any code related to user decorator, it triggers an autoload errorundefined local variable or method acts_as_paranoid for Spree::User:Class
for some reason here https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L11= is not finding the
Spree::SoftDeletable
module, tried to useacts_as_paranoid
but all the references were removed here https://github.com/solidusio/solidus_auth_devise/commit/11b9fa9cd1525b15dd7a7ecbca8d55511ff5528fGemfile
Decorator
Log