rails-geocoder 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/geocoder.rb +3 -3
- data/rails-geocoder.gemspec +2 -2
- data/test/test_helper.rb +2 -0
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.5
|
data/lib/geocoder.rb
CHANGED
@@ -29,7 +29,7 @@ module Geocoder
|
|
29
29
|
latitude, longitude = location.is_a?(Array) ?
|
30
30
|
location : Geocoder.fetch_coordinates(location)
|
31
31
|
if latitude and longitude
|
32
|
-
|
32
|
+
near_scope_options(latitude, longitude, *args)
|
33
33
|
else
|
34
34
|
{}
|
35
35
|
end
|
@@ -63,7 +63,7 @@ module Geocoder
|
|
63
63
|
# +limit+ :: number of records to return (for LIMIT SQL clause)
|
64
64
|
# +offset+ :: number of records to skip (for LIMIT SQL clause)
|
65
65
|
#
|
66
|
-
def
|
66
|
+
def near_scope_options(latitude, longitude, radius = 20, options = {})
|
67
67
|
|
68
68
|
# set defaults/clean up arguments
|
69
69
|
options[:order] ||= 'distance ASC'
|
@@ -137,7 +137,7 @@ module Geocoder
|
|
137
137
|
def nearbys(radius = 20)
|
138
138
|
return [] unless geocoded?
|
139
139
|
lat,lon = self.class._get_coordinates(self)
|
140
|
-
self.class.
|
140
|
+
self.class.near([lat, lon], radius) - [self]
|
141
141
|
end
|
142
142
|
|
143
143
|
##
|
data/rails-geocoder.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rails-geocoder}
|
8
|
-
s.version = "0.8.
|
8
|
+
s.version = "0.8.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alex Reisner"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-26}
|
13
13
|
s.description = %q{Geocoder adds object geocoding and database-agnostic distance calculations to Ruby on Rails. It does not rely on proprietary database functions so finding geocoded objects in a given area is easily done using out-of-the-box MySQL or even SQLite.}
|
14
14
|
s.email = %q{alex@alexreisner.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-geocoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Reisner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-26 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|