Skip to content

Commit

Permalink
Merge pull request #18 from johnofsydney/use-person-or-group-in-FileI…
Browse files Browse the repository at this point in the history
…ngestor.transfers_upload

Use person or group in file ingestor.transfers upload
  • Loading branch information
johnofsydney authored Sep 12, 2024
2 parents e008995 + 2744476 commit 4ebdce4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/models/concerns/transfer_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def consolidated_transfers(depth: 0, results: [], visited_nodes: [], queue: [sel
results << transfer_struct(transfer:, depth: counter, direction: 'outgoing')
end

next unless node.class == Group # TODO - get rid of this, people can accept transfers too (make taker polymorphic as well)
Transfer.where(taker: node).find_each do |transfer|
results << transfer_struct(transfer:, depth: counter, direction: 'incoming')
end
Expand Down
4 changes: 2 additions & 2 deletions app/services/file_ingestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def affiliations_upload(file)
def transfers_upload(file)
csv = CSV.read(file, headers: true)
csv.each do |row|
giver = RecordGroup.call(row['giver'])
taker = RecordGroup.call(row['taker'])
giver = RecordPersonOrGroup.call(row["giver"])
taker = RecordPersonOrGroup.call(row["taker"])

transfer = Transfer.find_or_create_by(
giver: giver,
Expand Down
2 changes: 1 addition & 1 deletion app/services/record_person_or_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(name)

def person_or_group
regex_for_3_or_4_capitals = /\bHCF\b|\bINPEX\b|\bCMAX\b|\bSDA\b|\bONA\b|\bSPP\b|\bACCI\b|\bACTU\b|\bCEC\b|\bCLP|\bMSD\b|\bUNSW\b|\bAICR\b|\bAFUL\b/i
regex_for_company_words_1 = /Corporation|Transport|Tax Aid|Outcomes|Lifestyle/i
regex_for_company_words_1 = /Corporation|Transport|Tax Aid|Outcomes|Lifestyle|active super/i
regex_for_company_words_2 = /business|technology|shopping|toyota|bank|promotions|publications/i
regex_for_company_words_3 = /institute|horticultural|cleaning|technologies|centre/i
regex_for_company_words_4 = /Services|investments|entertainment|Insurance|Commerce/i
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/common/money_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Common::MoneySummary < ApplicationView

def initialize(entity:)
@entity = entity
end
end

def template
if money_in.present? || money_out.present?
Expand Down
4 changes: 3 additions & 1 deletion csv_data/other_people_groups_positions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ Menzies Research Centre, Tamsin Lawrence, Director, , , https://www.menziesrc.or
Menzies Research Centre, kristy mcsweeney, Director, , , https://www.menziesrc.org/directors
Menzies Research Centre, allan pidgeon, Director, , , https://www.menziesrc.org/directors
Menzies Research Centre, Adrian Tembel, Director, , , https://www.menziesrc.org/directors
Menzies Research Centre, Andrew Robb, Director, , , https://www.menziesrc.org/directors
Office of Scott Morrison, Yaron Finkelstein, Principal Private Secretary, 1/9/2018 , 23/05/2022, https://www.crikey.com.au/2023/06/01/crosby-textor-liberal-party-link-break/
Office of Scott Morrison, Scott Morrison
Crosby Textor, Yaron Finkelstein, CEO - Australia, 1/4/2015, 1/9/2018, https://www.crikey.com.au/2023/06/01/crosby-textor-liberal-party-link-break/
Fenwick Family, Elizabeth Fenwick
Fenwick Family, Simon Fenwick
Australians For Unity Ltd, Jacinta Nampijinpa Price, Spokesperson, , , https://www.abc.net.au/news/2023-05-11/key-no-camps-merge-to-strengthen-referendum-campaign/102329478
Australians For Unity Ltd, Warren Mundine, Spokesperson, , , https://www.abc.net.au/news/2023-05-11/key-no-camps-merge-to-strengthen-referendum-campaign/102329478
Australians For Unity Ltd, Warren Mundine, Spokesperson, , , https://www.abc.net.au/news/2023-05-11/key-no-camps-merge-to-strengthen-referendum-campaign/102329478
The Great Synagogue, David Lewis, President, , , https://www.neveragainisnow.com.au/whoarewe

0 comments on commit 4ebdce4

Please sign in to comment.