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

Prioritize db_config for current env when resolving config. #39791

Merged

Conversation

tgxworld
Copy link
Contributor

@tgxworld tgxworld commented Jul 6, 2020

Summary

Resolves #38440 (comment)
Resolves #36894 (comment)

@tgxworld tgxworld force-pushed the prioritize_db_config_in_current_env branch from 91aa7c2 to 04443b2 Compare July 7, 2020 09:30
@tgxworld tgxworld changed the title WIP: Prioritize db_config for current env when resolving config. Prioritize db_config for current env when resolving config. Jul 7, 2020
@tgxworld tgxworld marked this pull request as ready for review July 7, 2020 09:32
(db_config.for_current_env? && db_config.name == env.to_s)
end
configurations
.sort_by { |db_config| db_config.for_current_env? ? 0 : 1 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm disregarding the fact that we're doing two loops here since the size of the configurations array should be fairly small.

@eileencodes eileencodes merged commit b343a72 into rails:master Jul 31, 2020
@eileencodes
Copy link
Member

Thanks for opening this PR! I can't think of a better way to fix this problem so this change seems fine to me.

@tgxworld tgxworld deleted the prioritize_db_config_in_current_env branch August 3, 2020 00:49
@tgxworld
Copy link
Contributor Author

tgxworld commented Aug 3, 2020

@eileencodes Thank you for reviewing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants