geokit / geokit-rails

Official Geokit plugin for Rails/ActiveRecord. Provides location-based goodness for your Rails app. Requires the Geokit gem.
MIT License
1.57k stars 245 forks source link

NoMethodError (undefined method `loaded' for Mysql2:Module) #89

Closed IgorMiller closed 8 years ago

IgorMiller commented 8 years ago

Hello. I dont know if anyone have ever had this issue, nothing is on Google, but my adapter is not loading correctly. I have investigated the issue, the problem was in acts_as_mappable.rb, line around 101

unless Adapters.const_defined?(connection.adapter_name.camelcase)
  filename = connection.adapter_name.downcase
  require File.join("geokit-rails", "adapters", filename)
end
klass = Adapters.const_get(connection.adapter_name.camelcase)

The klass was defined in Adapters.constants as a Module, and not as a class, resulting in NoMethodError (undefined methodloaded' for Mysql2:Module)`

I have fixed this and will create a pull request. But I don't know why "Mysql2" was defined in Adapters as a Module :s

bertocq commented 8 years ago

I have this error also, why is the PR not merged?

mnoack commented 8 years ago

@bertocq it has now been merged. Purely a case of I don't always see notifications amongst everything else and also that things don't always pass coverage requirements, but I'll make exceptions, better a non covered bug fix than no bug fix.