Skip to content

Commit

Permalink
Merge pull request #67 from sunsheeppoplar/ay/scrape
Browse files Browse the repository at this point in the history
remove state/province/region etc. from player place of birth
  • Loading branch information
sunsheeppoplar authored Mar 18, 2017
2 parents d960eb2 + b6ecb6f commit af59123
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/player.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ def only_have_nationality
self.place_of_birth = ""
end

def removes_pob_region
# avoid entries where place of birth is deliberately set to empty string because TransferMarkt doesn't provide one to us yet
if self.place_of_birth == ""
return
else
self.place_of_birth = self.place_of_birth.split(',')[0]
self.save
end
end

def strip_nationality
deprecated_nations = ["Jugoslawien (SFR)","CSSR","UDSSR","Yugoslavia (Republic)"]
# we can update nationality from another source
Expand Down
2 changes: 2 additions & 0 deletions lib/tasks/get_gps_coords.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ namespace :app do
start = Time.now

club_players.each_with_index do |player, i|
player.removes_pob_region
pob = player.place_of_birth

player.strip_nationality # replaces specified nationalities with ""
nat = player.nationality

Expand Down

0 comments on commit af59123

Please sign in to comment.