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

Remove unused actions in controller callbacks #5566

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Dec 22, 2023

Summary

With Rails 7.1, callbacks only work with actions that are defined
on the controller. This check allowed us to notice we had this some
no more used actions.

This commit also enable the new configuration in the dummy app so we
will be able to spot new errors. The configuration needs to be defined
explicitely because it's not part of the load_defaults but it's copied
in the dummy application directly.

Took advantage of the change for adding another 7.1-only configuration
to the dummy app:

config.action_dispatch.show_exceptions = :none

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@kennyadsl kennyadsl self-assigned this Dec 22, 2023
@kennyadsl kennyadsl requested a review from a team as a code owner December 22, 2023 17:28
@github-actions github-actions bot added the changelog:solidus_backend Changes to the solidus_backend gem label Dec 22, 2023
@github-actions github-actions bot added changelog:solidus_api Changes to the solidus_api gem changelog:solidus_core Changes to the solidus_core gem labels Dec 22, 2023
@kennyadsl kennyadsl changed the title Remove unused action in backend adjustments controller callback Remove unused action in controller callbacks Dec 22, 2023
kennyadsl and others added 2 commits December 22, 2023 19:29
With Rails 7.1, callbacks only work with actions that are defined
on the controller. This check allowed us to notice we had this some
no more used actions.

This commit also enable the new configuration in the dummy app so we
will be able to spot new errors. The configuration needs to be defined
explicitely because it's not part of the load_defaults but it's copied
in the dummy application directly.

Took advantage of the change for adding another 7.1-only configuration
to the dummy app:

  config.action_dispatch.show_exceptions = :none
Removed the load_promotion_category method and its corresponding 
before_action for the non-existent :move action.
@rainerdema rainerdema merged commit d9cb1e1 into solidusio:main Dec 22, 2023
11 checks passed
@rainerdema rainerdema deleted the kennyadsl/fix-missing-action branch December 22, 2023 18:40
@kennyadsl kennyadsl changed the title Remove unused action in controller callbacks Remove unused actions in controller callbacks Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_admin changelog:solidus_api Changes to the solidus_api gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants