8000 Fix require in generated `bin/rails` with `--skip-active-job` by stevegeek · Pull Request #47014 · rails/rails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix require in generated bin/rails with --skip-active-job #47014

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

Merged
merged 1 commit into from
Jan 15, 2023

Conversation

stevegeek
Copy link
Contributor

Motivation / Background

Previously active_job/railtie was always required in a plugin's bin/rails even when the plugin was generated with the --skip-active-job option.

This fix ensures the require is commented out when active_job is not used.

Also updates a test that checks bin/rails with various skip options.

Detail

This Pull Request changes railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt to comment out the active_job require when it has been skipped.

The --skip-active-job option was introduced in this PR where the app generator files where updated but not the plugin bin/rails template.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.

This is my first contribution to Rails so please do let me know if anything else is needed. Thanks!

Previously `active_job/railtie` was always required even when the
plugin was generated with the `--skip-active-job` option. This fix
ensures the require is commented out when `active_job` is not used. Also
updates a test that checks `bin/rails` with various skip options.
@rails-bot rails-bot bot added the railties label Jan 15, 2023
@jonathanhefner jonathanhefner merged commit 5b427f9 into rails:main Jan 15, 2023
@jonathanhefner
Copy link
Member
jonathanhefner commented Jan 15, 2023

Thank you, @stevegeek! 🎉

Backported to 7-0-stable.

@stevegeek
Copy link
Contributor Author

Thanks @jonathanhefner, I also saw #47015, nice refactor of this!

jonathanhefner added a commit that referenced this pull request Jan 24, 2023
Fix require in generated `bin/rails` with `--skip-active-job`

(cherry picked from commit 5b427f9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0