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

DatabaseConfigurations#configs_for can accept a symbol in the name param #50061

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

andrewn617
Copy link
Contributor

@andrewn617 andrewn617 commented Nov 14, 2023

Motivation / Background

This Pull Request has been created because I am changing usages of find_db_config to configs_for in my app. I noticed that while you can pass a symbol to find_db_config you cannot for configs_for, meaning I have to add .to_s at call sites where I might be passing a symbol in. I think it would be nice if configs_for's name parameter worked with a symbol or a string.

Detail

This Pull Request changes the ActiveRecord::DatabaseConfigurations#configs_for method to accept a symbol for the name parameter. The name parameter is used for comparison in one place, so I just call to_s on it there.

Additional information

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.
  • 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.

@kmcphillips
Copy link
Contributor

This is great, thanks!

@eileencodes eileencodes merged commit d424cab into rails:main Nov 15, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants