Search code examples
rubyactiverecordsinatrageokit

Can Geokit work with AR in Sinatra?


I have a Sinatra app with AR bundled. Geokit-wise, I have the requirement to keep the logic in certain models provided by the acts_as_mappable mixin. Thing is, this mixin is part of geokit-rails3, not geokit. And that gems depends from rails 3. Isn't there a way to decouple the parts in order to make a reliable geokit-activerecord implementation instead of coupling it tightly to the framework?


Solution

  • If the geokit-rails3 gem depends on the rails gem you can do nothing about it. The only option left is to rewrite the geokit-rails3 gem or extract the parts needed from it into your project.

    I also suggest looking into the geocoder gem, since it seems to be better maintained at the moment (geokit is practically dead) and it comes with an ActiveRecord integration in the main gem itself...