Fix bug in configs_for
If a spec name was provided without an env name, config_for would return
the first config that matched the spec, regardless of environment name.
Now configs_for will return the database config that matches the
default env and requested spec name.
Additionally this commit has moved the default env call into a method
because I'm tired of typing so many lines every single time.
We considered either returning all configs that match that spec name or
raising an error if only spec was passed, but this change has the least
impact on current behavior and matches Active Record's assumptions: that
if you ask for configs it will always consider the current environment.
Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
Showing
想要评论请 注册 或 登录