Skip to content

Fix admin user edit link for custom user classes#6508

Open
minhluuquang wants to merge 1 commit into
solidusio:mainfrom
minhluuquang:fix-4010-custom-user-edit-link
Open

Fix admin user edit link for custom user classes#6508
minhluuquang wants to merge 1 commit into
solidusio:mainfrom
minhluuquang:fix-4010-custom-user-edit-link

Conversation

@minhluuquang

Copy link
Copy Markdown
Contributor

Fixes #4010.

This updates the legacy admin users index edit action to link directly to edit_admin_user_path instead of the admin user show path. That keeps the edit URL independent of the configured Spree.user_class name and avoids relying on the show action redirect.

The existing custom user class render spec now also asserts that the edit icon points to the admin user edit route.

Tests:

  • From backend/: bundle exec rspec spec/controllers/spree/admin/users_controller_spec.rb
  • bundle exec standardrb backend/spec/controllers/spree/admin/users_controller_spec.rb
  • bundle exec rake lint:erb

@minhluuquang minhluuquang requested a review from a team as a code owner June 29, 2026 09:39
@github-actions github-actions Bot added the changelog:solidus_backend Changes to the solidus_backend gem label Jun 29, 2026
@actual_user_class_name = Spree.user_class.name
Spree.user_class = "UserModel"
UserModel.create(email: "a@solidus.io")
@custom_user = UserModel.create(email: "a@solidus.io")

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.

What's the purpose of this instance variable?

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.68%. Comparing base (8d781ac) to head (d2e877a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6508   +/-   ##
=======================================
  Coverage   89.68%   89.68%           
=======================================
  Files         993      993           
  Lines       20863    20863           
=======================================
  Hits        18712    18712           
  Misses       2151     2151           

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

changelog:solidus_backend Changes to the solidus_backend gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using a Spree.user_class other than 'User' causes users/index view to break

2 participants