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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/geokit-rails/acts_as_mappable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]

filename = connection.adapter_name.downcase
require File.join("geokit-rails", "adapters", filename)
# Re-init the klass after require
klass = Adapters.const_get(connection.adapter_name.camelcase)
end
klass.load(self) unless klass.loaded
klass.new(self)
rescue LoadError
Expand Down