Skip to content

Commit

Permalink
fixed rake task to finally eliminate duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
aboutaaron committed Oct 14, 2012
1 parent ecd7569 commit ea08b97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/county.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace :county do
a.page.search(".incident_table").drop(1).each do |x| a.page.search(".incident_table").drop(1).each do |x|
my_county = County.new my_county = County.new
begin 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| counties.each do |z|
my_county.name = z my_county.name = z
end end
Expand Down Expand Up @@ -96,7 +96,7 @@ namespace :county do
################# #################
# County location # 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 << County.find_by_name(county_name).id
counties_arr.each do |val| counties_arr.each do |val|
f.county_id = val f.county_id = val
Expand Down

0 comments on commit ea08b97

Please sign in to comment.