geocode_records 1.0.0 → 1.0.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/update_table_from_csv.rb +1 -1
- data/lib/geocode_records/version.rb +1 -1
- data/spec/geocode_records_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83fb253418d4002fbfc73f142af3b3727941757c
|
4
|
+
data.tar.gz: 8b62d3741a7aeec0386a195075b5a71b0ed30ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 284069b053dc0a918487f3089bec1b73c54cc05f252480ca9701f47e654eacc5852c993736ed3f4bb22d86353acd11043f7f7b79671ec9185cd203a9a3f0602d
|
7
|
+
data.tar.gz: 735420c63e805174ec2dd5e4c4f18cf3b07c6c7d74455e5b52a7a4354a25485912639838984d520686100028bd2b8ab50c508da9e83c428bf8b4c142295c0877
|
data/CHANGELOG
CHANGED
@@ -87,7 +87,7 @@ class GeocodeRecords
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def create_tmp_table
|
90
|
-
memo = "geocode_records_#{table_name}_#{rand(999999)}"
|
90
|
+
memo = "geocode_records_#{table_name}_#{rand(999999)}".gsub(/[^a-z0-9_]/i, '')
|
91
91
|
GeocodeRecords.run_sql(
|
92
92
|
database_url,
|
93
93
|
CREATE_TABLE_SQL.sub('$TMP_TABLE_NAME', memo)
|
@@ -10,6 +10,13 @@ describe GeocodeRecords do
|
|
10
10
|
expect(home.house_number_and_street).to eq('1038 E Dayton St')
|
11
11
|
end
|
12
12
|
|
13
|
+
it "geocodes quoted table name" do
|
14
|
+
home = Home.create! house_number_and_street: '1038 e deyton st', postcode: '53703'
|
15
|
+
GeocodeRecords.new(database_url: ENV.fetch('DATABASE_URL'), table_name: '"homes"').perform
|
16
|
+
home.reload
|
17
|
+
expect(home.house_number_and_street).to eq('1038 E Dayton St')
|
18
|
+
end
|
19
|
+
|
13
20
|
it "geocodes glob" do
|
14
21
|
home = Home.create! glob: '1038 e dayton st, madison, wi 53703'
|
15
22
|
subject
|