Closed aja closed 3 years ago
A lot of the internals of the plugin will have to be revamped for Rails3. Ideally using ARel instead of the SQL string munging we do now.
For a quick-and-dirty fix, paste the following in 'geokit-rails/lib/geokit-rails/acts_as_mappable.rb': http://gist.github.com/394328
gist code should go into ActsAsMappable::ClassMethods section of acts_as_mappable.rb
I wish I knew how to revamp this gem for Rails 3 myself, but does anyone know if significant progress has been made on this issue?
Another workaround it's adding ActiveRecord's old merge_conditions method to your initializers. First create the file: config/initializers/active_record_base.rb and put the following code in it (as a gist: http://gist.github.com/561092):
It works for me in Rails 3.1
I am closing all issues that are more than 6 years old now, as the gem has had significant updates and is likely people with these old issues are no longer having the issues. If you are currently still experiencing this issue or need help feel free to submit a new issue, thank you.
Ruby -> ruby 1.9.2dev (2010-04-04 trunk 27215) [i686-linux] Rails -> Rails 3.0.0.beta2
Statement producing the error: Location.find(:all, :origin =>[37.792,-122.393], :within=>10)
Stack trace: NoMethodError: undefined method'
merge_conditions' for #<Class:0x9692d24> from /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0.beta2/lib/active_record/base.rb:1154:in
method_missing' from /home/ahmad/geok/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:349:inapply_bounds_conditions' from /home/ahmad/geok/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:260:in
prepare_for_find_or_count' from /home/ahmad/geok/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:152:infind' from (irb):1 from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta2/lib/rails/commands/console.rb:47:in
start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta2/lib/rails/commands/console.rb:8:instart' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta2/lib/rails/commands.rb:34:in
<top (required)>' from ./script/rails:9:inrequire' from ./script/rails:9:in