geocode_records 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/geocode_records/geocode_csv.rb +1 -0
- data/lib/geocode_records/update_table_from_csv.rb +3 -0
- data/lib/geocode_records/version.rb +1 -1
- data/spec/geocode_records_spec.rb +14 -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: 8c7e219b14eec9ca84501e8e816d9509b5c5b4a6
|
4
|
+
data.tar.gz: 2655080db277f56a6c079d952c3fecd32bba9907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a56b58bad11648b5706e6af03a9e4406d2f9128d72f3ca85395bfdf8799ef12a522d4a6528f185a2113e23acb47f8ea0657ebdde14eae2224bc95a98b7e7cf7
|
7
|
+
data.tar.gz: a4407de14279b949e9aea326e7c2f9a16045789df69cfdc616df8bbf8b8465cbada07db93351af9d60100d1207fb687d85003b5d7d6dec23bb2388660fc9a721
|
data/CHANGELOG
CHANGED
@@ -19,6 +19,9 @@ class GeocodeRecords
|
|
19
19
|
if hn = row['house_number']
|
20
20
|
row['house_number'] = hn.to_i
|
21
21
|
end
|
22
|
+
if default_city = row.delete('default_city')
|
23
|
+
row['city'] = default_city
|
24
|
+
end
|
22
25
|
selector = { id: row.delete('id') }
|
23
26
|
setter = row
|
24
27
|
upsert.row selector, setter
|
@@ -111,6 +111,20 @@ describe GeocodeRecords do
|
|
111
111
|
expect(home.house_number_and_street).to eq('1039 E Dayton St')
|
112
112
|
end
|
113
113
|
|
114
|
+
it "overwrites unit" do
|
115
|
+
home = Home.create! house_number_and_street: '123 n blount st apt 403', city: 'madison', state: 'wisconsin'
|
116
|
+
GeocodeRecords.new(Home.all, include_invalid: true).perform
|
117
|
+
home.reload
|
118
|
+
expect(home.house_number_and_street).to eq('123 N Blount St Unit 403')
|
119
|
+
end
|
120
|
+
|
121
|
+
it "overwrites city name with default_city_name" do
|
122
|
+
home = Home.create! house_number_and_street: '7333 Bay Bridge Rd', city: 'eastvale', state: 'ca'
|
123
|
+
GeocodeRecords.new(Home.all, include_invalid: true).perform
|
124
|
+
home.reload
|
125
|
+
expect(home.city).to eq('Corona')
|
126
|
+
end
|
127
|
+
|
114
128
|
describe 'known issues' do
|
115
129
|
it "doesn't fix float-format postcode on records that it can't geocode" do
|
116
130
|
home = Home.create! house_number_and_street: 'gibberish', postcode: '53703.0'
|
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.1
|
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-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|