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

ActsAsMappable::distance_sql calls *_distance_sql with incorrect parameters #31

Open
jensb opened this issue Jun 5, 2012 · 3 comments

Comments

@jensb
Copy link

jensb commented Jun 5, 2012

call in acts_as_mappable.rb:

  sql = sphere_distance_sql(origin, units)

and code in adapters/postgresql.rb:

  def sphere_distance_sql(lat, lng, multiplier) # ...

and
def flat_distance_sql(origin, lat_degree_units, lng_degree_units)

Same thing in mysql.rb and mysql2.rb (and probably the others):

@jensb
Copy link
Author

jensb commented Jun 5, 2012

Oops. Sorry, I misread the code. The problem is actually not the parameters (those are correct) but the fact that in ActsAsMapple::*_distance_sql, customized column names for "lat" and "lng" are ignored and "lat"/"lng" is hardcoded. I use "latitude" and "longitude" and this is currently not possible with Geokit-Rails3.

@jensb
Copy link
Author

jensb commented Jun 6, 2012

Please pull hechien@8b3821e, that fixes it. Thanks!

@gevans
Copy link

gevans commented Jun 10, 2012

👍 I've named my columns latitude and longitude as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants