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

fix-Mysql2AdapterUndefinedMethodLoaded #90

Merged
merged 1 commit into from Jul 12, 2016
Merged

fix-Mysql2AdapterUndefinedMethodLoaded #90

merged 1 commit into from Jul 12, 2016

Conversation

IgorMiller
Copy link
Contributor

Mysql2 was present in Adapters.constants as a Module, and require was never called, resulting in Undefined method exception. Make sure the require is called if the const_get returns a Module and not a Class.

Fix to the issue: #89

Do you think this is a good fix? Thanks.

Mysql2 was present in Adapters.constants as a Module, and require was never called, resulting in Undefined method exception. Make sure the require is called if the const_get returns a Module and not a Class
@@ -98,6 +98,13 @@ def adapter
require File.join("geokit-rails", "adapters", filename)
end
klass = Adapters.const_get(connection.adapter_name.camelcase)
if klass.class == Module
# For some reason Mysql2 adapter was defined in Adapters.constants but was Module instead of a Class

Choose a reason for hiding this comment

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

Line is too long. [112/80]

@mnoack mnoack merged commit f85ca01 into geokit:master Jul 12, 2016
@mnoack
Copy link
Member

mnoack commented Jul 12, 2016

@IgorMiller Sorry for not getting back to your PR, now merged

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.

None yet

3 participants