Skip to content

[legacy_promotions]: Correct decorator naming#5946

Merged
tvdeyen merged 1 commit intosolidusio:mainfrom
mamhoff:correct-decorator-naming
Dec 3, 2024
Merged

[legacy_promotions]: Correct decorator naming#5946
tvdeyen merged 1 commit intosolidusio:mainfrom
mamhoff:correct-decorator-naming

Conversation

@mamhoff
Copy link
Copy Markdown
Contributor

@mamhoff mamhoff commented Nov 20, 2024

Summary

This changes the file names of decorators in the solidus_legacy_promotions gem to match Zeitwerk's expectations.
solidus_promotions is actually entirely fine.

This has been tested with solidusio/solidus_support#87, but is fully compatible with the classic way of loading each and every decorator on every app reload.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

@mamhoff mamhoff requested a review from a team as a code owner November 20, 2024 15:59
@github-actions github-actions Bot added the changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem label Nov 20, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.45%. Comparing base (9013f71) to head (e306a14).
Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5946      +/-   ##
==========================================
+ Coverage   87.81%   89.45%   +1.64%     
==========================================
  Files         476      782     +306     
  Lines       11656    17997    +6341     
==========================================
+ Hits        10236    16100    +5864     
- Misses       1420     1897     +477     

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

@mamhoff mamhoff force-pushed the correct-decorator-naming branch from c6f6c47 to fe18ce3 Compare November 20, 2024 16:18
Comment thread legacy_promotions/lib/solidus_legacy_promotions/engine.rb Outdated
@mamhoff mamhoff force-pushed the correct-decorator-naming branch from fe18ce3 to e639857 Compare November 20, 2024 17:14
If we want to use these decorators with Zeitwerk, their naming scheme
has to exchange module name and type. For example,

app/decorators/solidus_legacy_promotions/models/line_item_decorator.rb becomes
app/decorators/models/solidus/legacy_promotions/line_item_decorator.rb

This will eventually allow us to use Zeitwerk for loading decorators.
@mamhoff mamhoff force-pushed the correct-decorator-naming branch from e639857 to e306a14 Compare December 2, 2024 21:17
@tvdeyen tvdeyen merged commit ad84609 into solidusio:main Dec 3, 2024
@tvdeyen tvdeyen added the backport-v4.4 Backport this pull-request to v4.4 label Dec 3, 2024
@tvdeyen
Copy link
Copy Markdown
Member

tvdeyen commented Dec 6, 2024

Backport after #6016

@tvdeyen tvdeyen added backport-v4.4 Backport this pull-request to v4.4 and removed backport-v4.4 Backport this pull-request to v4.4 labels Dec 6, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 6, 2024

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

Labels

backport-v4.4 Backport this pull-request to v4.4 changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants