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

Arel SQLiteral error #67

Open jtomaslobo opened 9 years ago

jtomaslobo commented 9 years ago

Hello, I would like to know what can I do to avoid this error

NameError: uninitialized constant Arel::SqlLiteral

Whenever I try to use

Item.within(3.9, :origin => [37.792, -122.393])

or anything similar.

Thanks, Thomas

dmastylo commented 9 years ago

Anyone figured this out?

jtomaslobo commented 9 years ago

Not me, I am using a different lib right now

Enviado desde mi iPhone

El 12-01-2015, a las 2:42, Damian Mastylo notifications@github.com escribió:

Anyone figured this out?

— Reply to this email directly or view it on GitHub.

tagliala commented 9 years ago

(partially?) Fixed via #65

use the master branch

gem 'geokit-rails', github: 'geokit/geokit-rails'

You should also add units (e.g.: units: :kms) to your within clause: when I do not specify that parameter I got this error:

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
esbanarango commented 9 years ago

:+1:

dmastylo commented 9 years ago

Yeah I switched to track the master branch immediately after posting the issue, but the gem really should be pushed up so people installing it won't come up with the same issue!

@jtomaslobo what library are you using?

mnoack commented 9 years ago

@tagliala @esbanarango @dmastylo If someone will do a PR to test and fix the units issue (It would be nice to have an error like "you must set units", or perhaps default to kms as that's 'the' standard unit)

Then i'm happy to push out a gem release. I just hate pushing out gem releases which fixes 1 issue, but for others will cause a new issue.

dmastylo commented 9 years ago

@mnoack Totally understandable!

tagliala commented 9 years ago

@mnoack sorry I switched to another library