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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bffb7333678baee4fe92ba535fe31c94ff1dc05b
4
- data.tar.gz: c4450f1647e77e47d4e2986124cd7c6889c520e9
3
+ metadata.gz: 21a4000dec35d9e348e5d08e8cc134ea770c8b2f
4
+ data.tar.gz: a90cf2b53712ce6fd19cad8c332229f55854a943
5
5
  SHA512:
6
- metadata.gz: 1b1fc9a9aa539b6ab95d3ad6bb075ab271e127b29c8fcd0fdacb02e7eb34790dda26eb5fab94af9cc8b52b58b77efde86afafb6c4f1b458797a122bef1d9afba
7
- data.tar.gz: e41b32652d3e48ce12a960ac3fcbd50aeb07f51f85e27f0c6a0dfa68837d585c964ca69334cfc03b216edad898306f8423356371aa63f741e49a2daad64f4da2
6
+ metadata.gz: 34a891649b15bcd2bbce05570e780dc38ea1e48afe3fab2fefcace3dfca7bbff592c74cf329c6303d39a733b2780f868862b4ed2d68f8720a6e88f2478ba99ef
7
+ data.tar.gz: be33ccd4bca6261e6a9e2661c931576dddf303d5279eb366b13127c660932f81ad270172410fc49a70d543fc358d5b85d20e6a873cc5e58af54f4739679a7621
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  *.a
14
14
  mkmf.log
15
15
  /node_modules/
16
+ log/*
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.3 / 2016-06-20
2
+
3
+ * Enhancements
4
+
5
+ * Don't even try to dump/geocode lines without city/postcode or glob
6
+
1
7
  0.1.2 / 2016-03-16
2
8
 
3
9
  * Enhancements
@@ -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
@@ -1,3 +1,3 @@
1
1
  class GeocodeRecords
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  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.2
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-03-16 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord