Skip to content

Conversation

jeromedalbert
Copy link
Contributor

@jeromedalbert jeromedalbert commented Sep 14, 2024

Follow-up to #52889 and #52919.

Motivation / Background

This Pull Request has been created because if you currently create a new Rails Main app with the --skip-action-cable option, the generated database.yml sets up a cable database for the production environment.

Steps to repro the issue:

  • Run rails new myapp --main --skip-action-cable; cd myapp
  • Expected behavior: the generated database.yml does not set up a cable database.
  • Actual behavior: the generated database.yml sets up a cable database:
    cable:
      <<: *default
      database: storage/production_cable.sqlite3
      migrations_paths: db/cable_migrate

Detail

This Pull Request changes the database .yml.tt templates to not set up the cable database when the --skip-action-cable is provided.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes 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.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

When creating a new rails app with the `--skip-action-cable` option,
the generated `database.yml` should not set up the `cable` database.
@rails-bot rails-bot bot added the railties label Sep 14, 2024
@dhh dhh merged commit 8f45ef8 into rails:main Sep 14, 2024
3 checks passed
dhh added a commit that referenced this pull request Sep 14, 2024
* main:
  Tweak Gemfile comment about Solid adapters (#52925)
  Do not set up cable DB if skipping action cable (#52923)
  Fixup enum schema methods' signature to accept kwargs
  Add if_not_exists option to add_enum_value
@jeromedalbert jeromedalbert deleted the no-cable-database-if-skip-action-cable branch September 14, 2024 19:09
DanielaVelasquez pushed a commit to DanielaVelasquez/rails that referenced this pull request Oct 3, 2024
When creating a new rails app with the `--skip-action-cable` option,
the generated `database.yml` should not set up the `cable` database.
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