geocode_records 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG +6 -0
- data/lib/geocode_records.rb +2 -2
- data/lib/geocode_records/version.rb +1 -1
- data/spec/geocode_records_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21a4000dec35d9e348e5d08e8cc134ea770c8b2f
|
4
|
+
data.tar.gz: a90cf2b53712ce6fd19cad8c332229f55854a943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34a891649b15bcd2bbce05570e780dc38ea1e48afe3fab2fefcace3dfca7bbff592c74cf329c6303d39a733b2780f868862b4ed2d68f8720a6e88f2478ba99ef
|
7
|
+
data.tar.gz: be33ccd4bca6261e6a9e2661c931576dddf303d5279eb366b13127c660932f81ad270172410fc49a70d543fc358d5b85d20e6a873cc5e58af54f4739679a7621
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
data/lib/geocode_records.rb
CHANGED
@@ -51,9 +51,9 @@ class GeocodeRecords
|
|
51
51
|
c = connection
|
52
52
|
c.unprepared_statement do
|
53
53
|
if glob
|
54
|
-
c.to_sql records.select('id', 'glob').arel, records.bind_values
|
54
|
+
c.to_sql records.select('id', 'glob').where.not(glob: nil).arel, records.bind_values
|
55
55
|
else
|
56
|
-
c.to_sql records.select('id', 'house_number_and_street', 'house_number', 'unit_number', 'city', 'state', "regexp_replace(postcode, '.0$', '') AS postcode").arel, records.bind_values
|
56
|
+
c.to_sql records.select('id', 'house_number_and_street', 'house_number', 'unit_number', 'city', 'state', "regexp_replace(postcode, '.0$', '') AS postcode").where('city IS NOT NULL OR postcode IS NOT NULL').arel, records.bind_values
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -44,6 +44,12 @@ end
|
|
44
44
|
require 'active_record'
|
45
45
|
ActiveRecord::Base.establish_connection
|
46
46
|
|
47
|
+
require 'logger'
|
48
|
+
require 'fileutils'
|
49
|
+
FileUtils.mkdir_p 'log'
|
50
|
+
logger = Logger.new 'log/test.log'
|
51
|
+
ActiveRecord::Base.logger = logger
|
52
|
+
|
47
53
|
class Home < ActiveRecord::Base
|
48
54
|
end
|
49
55
|
class GlobHome < ActiveRecord::Base
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocode_records
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|