activerecord-postgres-earthdistance
activerecord-postgres-earthdistance copied to clipboard
Search records with latitude and longitude within a radius
Bumps [rdoc](https://github.com/ruby/rdoc) from 5.1.0 to 6.3.1. Commits 9307f93 Version 6.3.1 a7f5d6a Use File.open to fix the OS Command Injection vulnerability in CVE-2021-31799 06112d5 Merge pull request #806 from kamipo/patch-1 bf7e134...
Bumps [activerecord](https://github.com/rails/rails) from 5.2.1.1 to 6.1.4. Release notes Sourced from activerecord's releases. 6.1.4 Active Support MemCacheStore: convert any underlying value (including false) to an Entry. See #42559. Alex Ghiculescu Fix...
Bumps [activesupport](https://github.com/rails/rails) from 5.2.1.1 to 6.1.4. Release notes Sourced from activesupport's releases. 6.1.4 Active Support MemCacheStore: convert any underlying value (including false) to an Entry. See #42559. Alex Ghiculescu Fix...
Convert radius input to float before multiplying. nil and non-numeric strings coerce to 0, so to_f is enough. Loosely typed languages are fun!
Since Rails5, `table_exists?` only works for tables, which makes `acts_as_geolocated` fail on materialized views. http://guides.rubyonrails.org/5_0_release_notes.html#active-record-deprecations
"DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "earth_distance(ll_to_earth(\"places\".\"latitude\", \"places\".\"longitude\"), ll_to_earth(57.707935, 11.958817)) ASC". Non-attribute arguments will be disallowed in Rails 6.0....
```ruby class Company < ApplicationRecord has_many :addresses acts_as_geolocated through: :addresses end class Address < ApplicationRecord acts_as_geolocated lat: 'latitude', lng: 'longitude' belongs_to :company end > Company.within_radius(20_000, *point).selecting_distance_from(*point).first.distance => 11081.8179360831 > Company.includes(:addresses).within_radius(20_000,...
Currently, I need to build something like: ``` Select * from stores where (location in radius 10km) or name = 'Hola' ``` Do we support this feautre?
In container builds, there may not be a database present at all, raising `ActiveRecord::ConnectionNotEstablished`. This catches the error, allowing activities like asset precompilation in container builds without access to a...