rgeo/activerecord-postgis-adapter

How to use built in methods for distance calcs, rather than string building examples found online

Closed this issue · 0 comments

I've been looking at this adapter for a while and decided to start using it after I saw something that looked like an example of how not to manually build strings for sending to an SQL server in the tests:-

https://github.com/rgeo/activerecord-postgis-adapter/blob/master/test/spatial_queries_test.rb

I'm really struggling to work out how to accomplish this despite looking at the rdocs and scratching my head.

I've asked on stack overflow about what I could be doing wrong so I won't duplicate the code here (unless that's desired)

http://stackoverflow.com/questions/30031502/how-to-handle-simple-geospatial-queries-distances-in-ruby-with-activerecord-po

Any help appreciated!