Permalink
Browse files

fixed rake task to finally eliminate duplicates

  • Loading branch information...
1 parent ecd7569 commit ea08b97331563788b38a8030878caff3d6adaba7 @aboutaaron committed Oct 14, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/tasks/county.rake
View
@@ -8,7 +8,7 @@ namespace :county do
a.page.search(".incident_table").drop(1).each do |x|
my_county = County.new
begin
- counties << x.search(":nth-child(3) td:nth-child(2)").text.gsub(/\b\sCounty|Counties/,'').gsub(/\W$/,"")
+ counties << x.search(":nth-child(3) td:nth-child(2)").text.gsub(/\b\sCounty|Counties/,'').gsub(/\W$/,"").gsub(/\s$/,"")
counties.each do |z|
my_county.name = z
end
@@ -96,7 +96,7 @@ namespace :county do
#################
# County location
#################
- county_name = fire.search(":nth-child(3) td:nth-child(2)").text.gsub(/\b\sCounty|Counties/,'').gsub(/\W$/,"")
+ county_name = fire.search(":nth-child(3) td:nth-child(2)").text.gsub(/\b\sCounty|Counties/,'').gsub(/\W$/,"").gsub(/\s$/,"")
counties_arr << County.find_by_name(county_name).id
counties_arr.each do |val|
f.county_id = val

0 comments on commit ea08b97

Please sign in to comment.