Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6087159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:50:20+00:00 2026-05-23T11:50:20+00:00

I am playing around with Geokit-Rails (https://github.com/andre/geokit-rails) and I need to find all records

  • 0

I am playing around with Geokit-Rails (https://github.com/andre/geokit-rails) and I need to find all records within 10 miles of an origin. Here’s my error:

Company.find(:all, :origin=>'New York, NY', :within=>10)
NoMethodError: undefined method `merge_conditions' for #<Class:0x0000010832f740>
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.1/lib/active_record/base.rb:1016:in 'method_missing'
from /Users/san/Documents/sanj/app/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:349:in `apply_bounds_conditions'
from /Users/san/Documents/sanj/app/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:260:in `prepare_for_find_or_count'
from /Users/san/Documents/sanj/app/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb:152:in `find'
from (irb):4
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:44:in `start'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:8:in `start'
from /Users/san/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

I have acts_as_mappable in Company.rb and I have migrated the columns lat and lng into Company. Where am I going wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:50:20+00:00Added an answer on May 23, 2026 at 11:50 am

    I just stumbled across this very thing myself.

    This is totally a 1-minute hack fix, but since it’s a relatively harmless method insertion that won’t affect much outside of it’s scope of use, I just added the method straight into the plugin.

    merge_conditions is a deprecated ActiveRecord::Base method from rails 2.3.8.

    inserted into app/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb

      private
        def merge_conditions(*conditions)
        segments = []
    
        conditions.each do |condition|
          unless condition.blank?
            sql = sanitize_sql(condition)
            segments << sql unless sql.blank?
          end
        end
    
        "(#{segments.join(') AND (')})" unless segments.empty?
        end
    

    I’m not exactly sure what replaced this kind of manual SQL condition chaining (maybe :scopes?), so the geokit code is a little old, but sometimes a 1-minute hack fix is all you need especially when the hack is contained within an older external library…

    I guess I’ll find out if the original code calls merge_conditions anywhere else tho. Maybe I’ll take the time to figure out the ‘proper’ way to update this code if it’s still being actively managed.

    We’re not the only ones experiencing this problem.

    Gonna have to try myModel.geo_scope like the first comment, bblzzz…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im playing around with the Devise invitable gem: https://github.com/scambra/devise_invitable It's working fine. But how
After playing around with https://battlelog.battlefield.com/ and https://github.com/ I noticed it does not reload the
Just playing around with Rails 3.1 at the moment, and one issue I'm having
I playing around with a function that I want to bind to all the
After playing around with links in Rails for a view hours i've managed to
Playing around with Python - tkInter - Entry widget - when I use validatecommand
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
Just playing around with the now released Silverlight 2.0. I'm trying to put a
While playing around with regexps in Scala I wrote something like this: scala> val
been playing around with ResolveClientUrl(~/Confirmation.aspx) and other methods.. I am tryin go get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.