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: 1c47a1398981c4a66255e7539712df6343c33791
4
- data.tar.gz: 2ff076ca1b78a76daa37b915dbe5b15c02b2f904
3
+ metadata.gz: 14914cf3227e2902f8116b489d41e3210603a9c1
4
+ data.tar.gz: b4226864db951d270d472f3d14921a30568bb258
5
5
  SHA512:
6
- metadata.gz: 01d68f1a5c84ccc17dda51536625e38ef64f790214035cccad2c9b359c8889bad9837f31e108fb307fb02baf54a6ad7418322d518a43b888ba80d880cf511daf
7
- data.tar.gz: '0719bc8b1e9c9f8dddb2610536868f6b8027eb3adc8fa19d640c3d2df89a4f73ccb1533f405c40f57c10c866575e27198cf881eb023ed6934958aa890cefcaff'
6
+ metadata.gz: ee07956cd76fcd31ba907d8a5e7c8aaf8d1da42034e188a4e76f5c7930f6a3b0dc454ab7a2dcabb8f443c3c5b4dd057433d3331f721a4871edcc5a2bea16d5d9
7
+ data.tar.gz: 7e3ffb6b064c3a0ff0af310f446c2f83fdfce42693ed856917ec04d4c254f6964742226c0a6d0fd2dbcfefd8109949544c982e1a81ca585c5dde42dccee2d9b2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-postgres-earthdistance (0.7.0)
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.0)
13
- activesupport (= 5.2.0)
14
- activerecord (5.2.0)
15
- activemodel (= 5.2.0)
16
- activesupport (= 5.2.0)
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.0)
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.0.5)
25
+ concurrent-ruby (1.1.3)
26
26
  diff-lcs (1.3)
27
- i18n (1.0.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.0.0)
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.1
67
+ 1.16.3
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "activerecord-postgres-earthdistance"
7
- s.version = "0.7.0"
7
+ s.version = "0.7.1"
8
8
 
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.license = "MIT"
@@ -6,17 +6,20 @@ module ActiveRecordPostgresEarthdistance
6
6
 
7
7
  module ClassMethods
8
8
  def acts_as_geolocated(options = {})
9
- if table_exists?
10
- cattr_accessor :latitude_column, :longitude_column, :through_table, :distance_unit
11
- self.latitude_column = options[:lat] || (column_names.include?("lat") ? "lat" : "latitude")
12
- self.longitude_column = options[:lng] ||
13
- (column_names.include?("lng") ? "lng" : "longitude")
14
- self.through_table = options[:through]
15
- self.distance_unit = options[:distance_unit]
16
- else
17
- puts "[WARNING] table #{table_name} doesn't exist, acts_as_geolocated won't work. Skip this warning if you are running db migration"
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.0
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-04-18 00:00:00.000000000 Z
11
+ date: 2018-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord