Skip to content
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

Make state machine modules auto-loadable #6056

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Jan 6, 2025

Summary

This moves the default state machine modules into app, making them autoloadable. In order to accomplish that, I had to change the superclass of Spree::Core::StateMachines to a
Spree::Preferences::Configuration, so that the class_name_attribute method is available. Technically, we're using it for modules here, but that does not actually matter in this context. We just need it to run constantize.

This also removes some custom "autoloading" code that is not actually all that necessary. The configuration interface stays the same.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

This moves the default state machine modules into `app`, making them
autoloadable. In order to accomplish that, I had to change the
superclass of `Spree::Core::StateMachines` to a
`Spree::Preferences::Configuration`, so that the `class_name_attribute`
method is available. Technically, we're using it for modules here, but
that does not actually matter in this context. We just need it to run
`constantize`.

This also removes some custom "autoloading" code that is not actually
all that necessary. The configuration interface stays the same.
@mamhoff mamhoff requested a review from a team as a code owner January 6, 2025 13:00
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Jan 6, 2025
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.57%. Comparing base (9aa24a5) to head (01d378b).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6056      +/-   ##
==========================================
- Coverage   89.59%   89.57%   -0.02%     
==========================================
  Files         791      791              
  Lines       18269    18234      -35     
==========================================
- Hits        16368    16333      -35     
  Misses       1901     1901              

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants