Skip to content

Commit

Permalink
Fix capitalize at fraction name
Browse files Browse the repository at this point in the history
  • Loading branch information
beastie87 committed Sep 12, 2019
1 parent 4909354 commit caa5f21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def person_name_to_id(abbreviated_name, faction_name)
def faction_name_to_id(name)
@factions ||= morph_scraper_query("beastie87/ukraine_verkhovna_rada_deputies",
"SELECT DISTINCT COALESCE(faction_id, 'party/Позафракційні') AS faction_id, COALESCE(faction, 'Позафракційні') AS faction FROM 'data'")
if faction = @factions.find { |f| f["faction"].include? name }
if faction = @factions.find { |f| f["faction"].capitalize.include? name.capitalize }
faction["faction_id"]
else
raise "Faction ID not found for: #{name}"
Expand Down

0 comments on commit caa5f21

Please sign in to comment.