Skip to content

Commit

Permalink
Merge commit 'f4cbea2281f6e15af1fa7e270618b8ec77fdb9b5' into june-new…
Browse files Browse the repository at this point in the history
…-version

# Conflicts:
#	app/services/file_ingestor.rb
  • Loading branch information
johnofsydney committed Jun 13, 2024
2 parents aca96a8 + f4cbea2 commit 974a28b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions app/services/file_ingestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def federal_parliamentarians_upload(file)
# for major parties the branch is a subgroup of the state party
# for minor parties the branch is a subgroup of the federal party
# add this back later if wanted
unless senator && false
unless senator || true # it is the || true which prevents this from running. remove if needed
branch_name = "#{federal_party.less_level} Branch for #{row['electorate']} Electorate"
branch = RecordGroup.call(branch_name)

Expand Down Expand Up @@ -126,7 +126,7 @@ def ministries_upload(file)
ministry_group = RecordGroup.call(row['group'])

person = RecordPerson.call(row['person'])
title = row['title'].strip
title = row['title'].strip if row['title']
start_date = parse_date(row['start_date'])
end_date = parse_date(row['end_date'])

Expand Down Expand Up @@ -155,8 +155,8 @@ def general_upload(file)
person = RecordPerson.call(row['person'])

title = row['title'].strip if row['title'].present?
start_date = parse_date(row['start_date'])
end_date = parse_date(row['end_date'])
start_date = parse_date(row['start_date']) if row['start_date'].present?
end_date = parse_date(row['end_date']) if row['end_date'].present?

# the membership may not exist, if so, we need to create it
membership = Membership.find_or_create_by(
Expand Down
6 changes: 3 additions & 3 deletions app/views/components/common/money_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Common::MoneySummary < ApplicationView

attr_reader :entity

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

Expand Down Expand Up @@ -45,14 +45,14 @@ def template
end

def money_in
amount = Transfer.where(taker: entity).sum(:amount)
amount = Transfer.where(taker_type: entity.class.name, taker_id: entity.id).sum(:amount)
return unless amount.positive?

number_to_currency amount, precision: 0
end

def money_out
amount = Transfer.where(giver: entity).sum(:amount)
amount = Transfer.where(giver_type: entity.class.name, giver_id: entity.id).sum(:amount)
return unless amount.positive?

number_to_currency amount, precision: 0
Expand Down
4 changes: 2 additions & 2 deletions csv_data/other_people_groups_positions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ The Trustee for ST Baker Family Trust, Trevor St-Baker, Owner
Pesca Aviation, Steve Baxter,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Advance Australia, Matthew Sheahan,,,, https://www.advanceaustralia.org.au/about-menu
Hadley Holdings, Brian Anderson,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Kennards Self Storage's, Sam Kennard,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Kennards Self Storage, Sam Kennard, Owner,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Centre for Independent Studies, Sam Kennard, Board Memeber,,, https://reneweconomy.com.au/the-network-of-conservative-think-tanks-out-to-kill-the-switch-to-renewables/
Siesta Holdings, Sam Kennard,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Siesta Holdings Australia Pty Ltd, Sam Kennard,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Pitcher Partners, Ronald Pitcher,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Consolidated Pastoral, Kenneth Warriner,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
JMR Management Consultancy Services, Brett Ralph,,,, https://www.afr.com/rich-list/the-heavy-hitters-behind-australia-s-biggest-conservative-lobby-group-20240201-p5f1pt
Expand Down
22 changes: 11 additions & 11 deletions lib/tasks/add_records.rake
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ namespace :lester do
ActiveRecord::Base.connection.reset_pk_sequence!('people')

donation_files = [
# 'csv_data/Annual_Donations_Made_2018.csv',
# 'csv_data/Annual_Donations_Made_2019.csv',
# 'csv_data/Annual_Donations_Made_2020.csv',
# 'csv_data/Annual_Donations_Made_2021.csv',
# 'csv_data/Annual_Donations_Made_2022.csv',
'csv_data/Annual_Donations_Made_2018.csv',
'csv_data/Annual_Donations_Made_2019.csv',
'csv_data/Annual_Donations_Made_2020.csv',
'csv_data/Annual_Donations_Made_2021.csv',
'csv_data/Annual_Donations_Made_2022.csv',
'csv_data/Annual_Donations_Made_2023.csv',
]

Expand All @@ -42,10 +42,10 @@ namespace :lester do

federal_parliamentarians = [
'csv_data/wiki_feds_current_mps_cleaned.csv',
# 'csv_data/wiki_feds_current_senators_cleaned.csv',
# 'csv_data/wiki_feds_ending_2019_cleaned.csv',
# 'csv_data/wiki_feds_ending_2022_cleaned.csv',
# 'csv_data/wiki_feds_senators_ending_2019_cleaned.csv',
'csv_data/wiki_feds_current_senators_cleaned.csv',
'csv_data/wiki_feds_ending_2019_cleaned.csv',
'csv_data/wiki_feds_ending_2022_cleaned.csv',
'csv_data/wiki_feds_senators_ending_2019_cleaned.csv',
'csv_data/wiki_feds_senators_ending_2022_cleaned.csv'
]

Expand All @@ -54,8 +54,8 @@ namespace :lester do
end

federal_ministries = [
# 'csv_data/ministries_morrison.csv',
# 'csv_data/ministries_turnbull.csv',
'csv_data/ministries_morrison.csv',
'csv_data/ministries_turnbull.csv',
]

federal_ministries.each do |file|
Expand Down

0 comments on commit 974a28b

Please sign in to comment.