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

Use symbols everywhere for database configurations #37185

Merged
merged 1 commit into from
Sep 13, 2019

Commits on Sep 13, 2019

  1. Use symbols everywhere for database configurations

    Previously in some places we used symbol keys, and in some places we used
    string keys. That made it pretty confusing to figure out in a particular
    place what type of configuration object you were working with.
    
    Now internally, all configuration hashes are keyed by symbols and
    converted to such on the way in.
    
    A few exceptions:
    
    - `DatabaseConfigurations#to_h` still returns strings for backward compatibility
    - Same for `legacy_hash`
    - `default_hash` previously could return strings, but the associated
      comment mentions it returns symbol-key `Hash` and now it always does
    
    Because this is a change in behavior, a few method renames have happened:
    
    - `DatabaseConfig#config` is now `DatabaseConfig#configuration_hash` and returns a symbol-key `Hash`
    - `ConnectionSpecification#config` is now `ConnectionSpecification#underlying_configuration_hash` and returns the `Hash` of the underlying `DatabaseConfig`
    - `DatabaseConfig#config` was added back, returns `String`-keys for backward compatibility, and is deprecated in favor of the new `configuration_hash`
    
    Co-authored-by: eileencodes <eileencodes@gmail.com>
    eileencodes authored and seejohnrun committed Sep 13, 2019
    Configuration menu
    Copy the full SHA
    ce9b197 View commit details
    Browse the repository at this point in the history