activerecord-postgres-earthdistance 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14914cf3227e2902f8116b489d41e3210603a9c1
|
4
|
+
data.tar.gz: b4226864db951d270d472f3d14921a30568bb258
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee07956cd76fcd31ba907d8a5e7c8aaf8d1da42034e188a4e76f5c7930f6a3b0dc454ab7a2dcabb8f443c3c5b4dd057433d3331f721a4871edcc5a2bea16d5d9
|
7
|
+
data.tar.gz: 7e3ffb6b064c3a0ff0af310f446c2f83fdfce42693ed856917ec04d4c254f6964742226c0a6d0fd2dbcfefd8109949544c982e1a81ca585c5dde42dccee2d9b2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activerecord-postgres-earthdistance (0.7.
|
4
|
+
activerecord-postgres-earthdistance (0.7.1)
|
5
5
|
activerecord (>= 3.1)
|
6
6
|
pg
|
7
7
|
rake
|
@@ -9,26 +9,26 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (5.2.
|
13
|
-
activesupport (= 5.2.
|
14
|
-
activerecord (5.2.
|
15
|
-
activemodel (= 5.2.
|
16
|
-
activesupport (= 5.2.
|
12
|
+
activemodel (5.2.1.1)
|
13
|
+
activesupport (= 5.2.1.1)
|
14
|
+
activerecord (5.2.1.1)
|
15
|
+
activemodel (= 5.2.1.1)
|
16
|
+
activesupport (= 5.2.1.1)
|
17
17
|
arel (>= 9.0)
|
18
|
-
activesupport (5.2.
|
18
|
+
activesupport (5.2.1.1)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 0.7, < 2)
|
21
21
|
minitest (~> 5.1)
|
22
22
|
tzinfo (~> 1.1)
|
23
23
|
arel (9.0.0)
|
24
24
|
coderay (1.1.1)
|
25
|
-
concurrent-ruby (1.
|
25
|
+
concurrent-ruby (1.1.3)
|
26
26
|
diff-lcs (1.3)
|
27
|
-
i18n (1.
|
27
|
+
i18n (1.1.1)
|
28
28
|
concurrent-ruby (~> 1.0)
|
29
29
|
method_source (0.8.2)
|
30
30
|
minitest (5.11.3)
|
31
|
-
pg (1.
|
31
|
+
pg (1.1.3)
|
32
32
|
pry (0.10.4)
|
33
33
|
coderay (~> 1.1.0)
|
34
34
|
method_source (~> 0.8.1)
|
@@ -64,4 +64,4 @@ DEPENDENCIES
|
|
64
64
|
rspec
|
65
65
|
|
66
66
|
BUNDLED WITH
|
67
|
-
1.16.
|
67
|
+
1.16.3
|
@@ -6,17 +6,20 @@ module ActiveRecordPostgresEarthdistance
|
|
6
6
|
|
7
7
|
module ClassMethods
|
8
8
|
def acts_as_geolocated(options = {})
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
begin
|
10
|
+
if table_exists?
|
11
|
+
cattr_accessor :latitude_column, :longitude_column, :through_table, :distance_unit
|
12
|
+
self.latitude_column = options[:lat] || (column_names.include?("lat") ? "lat" : "latitude")
|
13
|
+
self.longitude_column = options[:lng] ||
|
14
|
+
(column_names.include?("lng") ? "lng" : "longitude")
|
15
|
+
self.through_table = options[:through]
|
16
|
+
self.distance_unit = options[:distance_unit]
|
17
|
+
else
|
18
|
+
puts "[WARNING] table #{table_name} doesn't exist, acts_as_geolocated won't work. Skip this warning if you are running db migration"
|
19
|
+
end
|
20
|
+
rescue ActiveRecord::NoDatabaseError
|
21
|
+
rescue PG::ConnectionBad
|
18
22
|
end
|
19
|
-
rescue ActiveRecord::NoDatabaseError
|
20
23
|
end
|
21
24
|
|
22
25
|
def within_box(radius, lat, lng)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgres-earthdistance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diogo Biazus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|