Fix ActiveRecord::Base.establish_connection#132
Open
diedthreetimes wants to merge 1 commit intosinatra-activerecord:masterfrom
Open
Fix ActiveRecord::Base.establish_connection#132diedthreetimes wants to merge 1 commit intosinatra-activerecord:masterfrom
diedthreetimes wants to merge 1 commit intosinatra-activerecord:masterfrom
Conversation
Connection management in ActiveRecord > 6.1 is broken for string urls as configurations are not stored. E.g. with the error: ``` activerecord-7.2.1/lib/active_record/database_configurations.rb:229:in `resolve_symbol_connection': The `default_env` database is not configured for the `default_env` environment. (ActiveRecord::AdapterNotSpecified) Available database configurations are: ```
Author
|
Specifically this commit fixes |
Member
|
Thank you for the PR! I will look into it soon |
Member
|
@diedthreetimes I tried create another PR with the same code change (#137 ), to test it against the latest CI, seems like the test failed (on the spec that use database url and database file together). I think the issue could be that "=" (instead of "||=") will override one of the previously defined configuration environment, would it be possible to assign configuration to that specific environment for this PR? (eg: config[env] = the_config_here_for_database_string ) |
Author
|
Yes should be fine. Let me update the PR.
…On Tue, Dec 3, 2024, 12:32 AM soulchild ***@***.***> wrote:
@diedthreetimes <https://github.com/diedthreetimes> I tried create
another PR with the same code change (#137
<#137>
), to test it against the latest CI, seems like the test failed (on the
spec that use database url and database file together).
I think the issue could be that "=" (instead of "||=") will override one
of the previously defined configuration environment, would it be possible
to assign configuration to that specific environment for this PR? (eg:
config[env] = the_config_here_for_database_string )
—
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFEE6K4GXHRHHCMAS526KD2DVUCNAVCNFSM6AAAAABOU7YPXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJTHA2TSNJYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connection management in ActiveRecord >= 6.0 is broken for string urls as configurations are not stored.
E.g. with the error: