Skip to content

Commit 7e8c980

Browse files
authored
Merge pull request #279 from AnaTofuZ/modofied_csv_converts
`order` 値がCSVに書いてあるとおりの値になる用に修正
2 parents 607e745 + 4f908a5 commit 7e8c980

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/tasks/dojos.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ namespace :dojos do
2828

2929
dojos.each do |dojo|
3030
d = Dojo.find_or_initialize_by(id: dojo['id'])
31-
3231
d.name = dojo['name']
3332
d.email = ''
3433
d.order = dojo['order'] || search_order_number(dojo['name'])
@@ -49,7 +48,7 @@ namespace :dojos do
4948
def search_order_number(pre_city)
5049

5150
if /(?<city>.+)\s\(.+\)/ =~ pre_city
52-
table = CSV.table(Rails.root.join('db','city_code.csv'))
51+
table = CSV.table(Rails.root.join('db','city_code.csv'), {:converters => nil})
5352
row = table.find{ |r| r[:city].to_s.start_with?(city)}
5453
row ? row[:order] : raise("Failed to detect city code by #{pre_city}
5554
order値の自動設定ができませんでした。お手数ですが下記URLを参考に該当する全国地方公共団体コードをorder値にご入力ください。

0 commit comments

Comments
 (0)