Skip to content

Add establish connection to the alias hijacking.#427

Open
abMatGit wants to merge 1 commit into
thiagopradi:masterfrom
abMatGit:establish_connection_alias
Open

Add establish connection to the alias hijacking.#427
abMatGit wants to merge 1 commit into
thiagopradi:masterfrom
abMatGit:establish_connection_alias

Conversation

@abMatGit
Copy link
Copy Markdown

This fixes #426
Kudos to @camertron! \o/

Proposed solution:

Alias the establish_connection method to explicitly and return an establish_connection_without_octopus connection.

This will cause establish_connection configuration_without_database to return a MySQL2::Adapter class instead of a Octopus::Proxy class, from which we can successfully call connection.create_database and bypass Octopus::Proxy#method_missing

@thiagopradi
Copy link
Copy Markdown
Owner

hey @abMatGit - could you check why the test suite is failing? Thanks

@mckinnsb
Copy link
Copy Markdown

mckinnsb commented Jun 6, 2017

It seems like the tests are failing because he replaced octopus_establish_connection with establish_connection. Wondering if this will work if establish_connection is just aliased to octopus_establish_connection.

@mckinnsb
Copy link
Copy Markdown

mckinnsb commented Jun 8, 2017

It doesn't - I think this will require a more significant patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot run rake task db:create with mysql.

3 participants