Skip to content

Commit

Permalink
remove multisearch scope from Position
Browse files Browse the repository at this point in the history
fix mapping for United Australia Party
  • Loading branch information
johnofsydney committed Nov 12, 2024
1 parent 72c9ef9 commit 82456b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion app/models/position.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class Position < ApplicationRecord
include PgSearch::Model
multisearchable against: [:title]

belongs_to :membership

Expand Down
3 changes: 1 addition & 2 deletions app/services/map_group_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def map_or_return_name(name)
return 'Federal Independents' if name.match?(/Independent Fed/i)
return 'Waringah Independents' if name.match?(/(Warringah|Waringah).+(independent|Independant)/i)
return 'Lambie Network' if name.match?(/Lambie/i)
return 'United Australia Party' if name.match?(/United Australia Party/i)

return 'United Australia Party' if name.match?(/United Australia (Party|Federal)/i)
return "Pauline Hanson's One Nation" if name.match?(/Pauline Hanson|One Nation/i)

# specific exceptions
Expand Down
12 changes: 2 additions & 10 deletions spec/services/record_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@
'Australian Conservatives (Qld)' => 'Australian Conservatives',
'Australian Conservatives (Vic)' => 'Australian Conservatives',
'Australian Conservatives ACP' => 'Australian Conservatives',
# Independents
# 'David Pocock' => 'David Pocock Campaign',
# 'David Pocock - Davi' => 'David Pocock Campaign',
# 'David Pocock Campaign' => 'David Pocock Campaign',
# 'David Pocock Pty Ltd' => 'David Pocock Campaign',
# 'David Pocock/DAVI' => 'David Pocock Campaign',
# 'Zali Steggall' => 'Zali Steggall Campaign',
# 'Zali Steggall Campaign' => 'Zali Steggall Campaign',
# 'Kim for Canberra' => 'Kim for Canberra',
# 'Helen Haines' => 'Helen Haines Campaign',
# Other
'climate 200 Pty Ltd' => 'Climate 200 Pty Ltd',
'climate 200 pty ltd' => 'Climate 200 Pty Ltd',
Expand Down Expand Up @@ -224,6 +214,8 @@
'GetUp Ltd' => 'Get Up Limited',
'Alpha Diversification Pty Ltd' => 'Alpha Diversification Pty Ltd',
'Actus Services Pty Ltd' => 'Actus Services Pty Ltd',
'United Australia Party' => 'United Australia Party',
'United Australia Federal' => 'United Australia Party',
}
end

Expand Down

0 comments on commit 82456b9

Please sign in to comment.