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

Deprecate and replace #default_hash and #[] #38256

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

eileencodes
Copy link
Member

Database configurations are now objects almost everywhere, so we don't
need to fake access to a hash with #default_hash or its alias #[].
Applications should configs_for and pass env_name and spec_name to
get the database config object. If you're looking for the default for
the test environment you can pass configs_for(env_name: "test", spec_name: "primary"). Change test to development to get the dev config, etc.

#default_hash and #[] will be removed in 6.2.

Co-authored-by: John Crepezzi john.crepezzi@gmail.com

Database configurations are now objects almost everywhere, so we don't
need to fake access to a hash with `#default_hash` or it's alias `#[]`.
Applications should `configs_for` and pass `env_name` and `spec_name` to
get the database config object. If you're looking for the default for
the test environment you can pass `configs_for(env_name: "test", spec_name:
"primary")`. Change test to developement to get the dev config, etc.

`#default_hash` and `#[]` will be removed in 6.2.

Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
@eileencodes eileencodes added this to the 6.1.0 milestone Jan 17, 2020
@eileencodes eileencodes merged commit d72f940 into rails:master Jan 17, 2020
@eileencodes eileencodes deleted the deprecate-default-hash branch January 17, 2020 21:56
carlosantoniodasilva added a commit to heartcombo/devise that referenced this pull request Feb 3, 2021
Fix deprecation warning on Rails 6.1

Related changes in Rails:
rails/rails#38256
rails/rails#38536
koic added a commit to koic/test-queue that referenced this pull request Jan 25, 2023
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

1 participant