Skip to content

Move to Spree::SoftDeletable on users model#223

Merged
tvdeyen merged 2 commits into
solidusio:mainfrom
jtapia:chore/solidus-v.3.1.0-fix
Jan 3, 2026
Merged

Move to Spree::SoftDeletable on users model#223
tvdeyen merged 2 commits into
solidusio:mainfrom
jtapia:chore/solidus-v.3.1.0-fix

Conversation

@jtapia

@jtapia jtapia commented Jul 23, 2022

Copy link
Copy Markdown
Contributor

Summary

  • Based on the latest gemspec of auth-devise, move to Spree::SoftDeletable

@gsmendoza

Copy link
Copy Markdown
Contributor

Hello @jtapia !

  • Can you reproduce the issue on the latest patch version of Solidus, v3.1.7?
  • What Rails version are you using?

@jarednorman jarednorman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jtapia! The commit in this PR appears to two things:

  1. It removes support for Solidus versions prior to the introduction of Spree::SoftDeletable in order to fix an autoloading issue
  2. Fixes keyword usage in order to fix Ruby 3.x support in the specs.

We really like atomic commits on the Solidus projects, and expect some level of explanation in the commit messages. This article has a good example of what we expect.

If you split the commit in two and PR the Ruby 3.x compat change, we can get that merged right away. That's an easy rubber stamp.

As for the first thing, the soft deletion stuff, can you open an issue explaining the issue you're seeing? We need to understand what the issue is and confirm that this is the correct solution before we move forward with that change.

@jakepenn

jakepenn commented Jul 26, 2022

Copy link
Copy Markdown

I'm seeing this autoloader issue on 3.1.7 -- App boots well but after modifying hot reload crashes:

undefined local variable or method acts_as_paranoid for Spree::User:Class

gem 'rails', '6.1.4.1'

@gsmendoza

Copy link
Copy Markdown
Contributor

@jakemumu Can you tell what file you are modifying that causes hot reload to crash? How can we reproduce the error?

@jarednorman

Copy link
Copy Markdown
Member

We probably don't want https://github.com/solidusio/solidus/blob/master/core/app/models/concerns/spree/soft_deletable.rb to be code-reloaded. It sounds like there's an issue with code reload order with it.

@jtapia jtapia force-pushed the chore/solidus-v.3.1.0-fix branch from 53ebfeb to 966495a Compare July 26, 2022 16:57
@jtapia

jtapia commented Jul 26, 2022

Copy link
Copy Markdown
Contributor Author

@jarednorman ok, I moved it into 2 commits and created this issue #225
is anything else that do you need?

@jarednorman

Copy link
Copy Markdown
Member

If you put the keyword commit in a new PR we can merge it right away. I don't think the other commit will be the solution we want for the autoload issue though.

@jarednorman jarednorman mentioned this pull request Jul 26, 2022
@jtapia jtapia force-pushed the chore/solidus-v.3.1.0-fix branch from 966495a to 512fc62 Compare July 26, 2022 17:27
@jtapia

jtapia commented Jul 26, 2022

Copy link
Copy Markdown
Contributor Author

@jakemumu ok, here is the new PR #226

@jtapia

jtapia commented Jul 26, 2022

Copy link
Copy Markdown
Contributor Author

@jarednorman if you removed all the references for acts_as_paranoid here https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L11=, why we continue using here https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L14=?
for older Solidus versions is ok, but since 3.0 removed Paranoia, I think we don't need that condition anymore or if we want to continue supporting older versions, we gonna need to bring back the paranoia reference

@jtapia

jtapia commented Jul 26, 2022

Copy link
Copy Markdown
Contributor Author

@gsmendoza I'm using rails', '6.1.4.1' and didn't test it yet with Solidus v3.1.7, on the issue I added more information

@jarednorman

Copy link
Copy Markdown
Member

@jarednorman if you removed all the references for acts_as_paranoid here https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L11=, why we continue using here https://github.com/solidusio/solidus_auth_devise/blob/master/app/models/spree/user.rb#L14=?
for older Solidus versions is ok, but since 3.0 removed Paranoia, I think we don't need that condition anymore or if we want to continue supporting older versions, we gonna need to bring back the paranoia reference

I'm not sure I understand what you're asking. The conditional above allows stores that are significantly behind (pre-v2.10.4 I think) on their Solidus upgrades to still use the latest version of solidus_auth_devise.

@jakepenn

Copy link
Copy Markdown

I get what you're saying @jarednorman -- I think that sounds correct. During hot reloading that check is failing & it's trying to load paranoid -- on initial app launch it's all good. It must be the user loading first for some reason.

@gsmendoza -- It's not any single file but we use view_component gem in our app and I've noticed it occur whenever I edit a x_component.rb

@jarednorman

Copy link
Copy Markdown
Member

Yeah, it probably isn't significant what file you edit. Zeitwerk will reload everything if anything has changed since the last request.

@elia

elia commented Sep 29, 2022

Copy link
Copy Markdown
Member

I'm not sure I understand what you're asking. The conditional above allows stores that are significantly behind (pre-v2.10.4 I think) on their Solidus upgrades to still use the latest version of solidus_auth_devise.

@jarednorman the latest gemspec of auth-devise requires solidus 3.x, so I think it's ok to rely on Spree::SoftDeletable now. Any objections to merging other than updating the commit message?

@jarednorman

Copy link
Copy Markdown
Member

Ah, no, that's fine then.

@elia

elia commented Sep 30, 2022

Copy link
Copy Markdown
Member

@jtapia can you take care of updating the commit message and PR title?

@jtapia jtapia changed the title Fix autoload issue on Solidus v3.1.0 Move to Spree::SoftDeletable on user model Sep 30, 2022
@jtapia jtapia changed the title Move to Spree::SoftDeletable on user model Move to Spree::SoftDeletable on users model Sep 30, 2022
@jtapia

jtapia commented Sep 30, 2022

Copy link
Copy Markdown
Contributor Author

@elia I updated it, but not sure if that is the title and description you want to, please let me know if you want to change it and I can do it

@elia

elia commented Sep 30, 2022

Copy link
Copy Markdown
Member

@jtapia I mentioned the PR title, but the most important thing is the commit message, for future lookups, as the current one could be confusing 🙏

@sislr

sislr commented May 13, 2023

Copy link
Copy Markdown

@jarednorman would you mind looking into this again?

@tvdeyen tvdeyen merged commit 3fb1685 into solidusio:main Jan 3, 2026
18 checks passed
@codecov

codecov Bot commented Jan 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (5a8d695) to head (cd13355).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #223   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants