Parameterize civicrm dump directory

This commit is contained in:
Hugo Peixoto 2022-09-29 18:27:30 +01:00
parent 0950c0dbb0
commit 897b48e377

View File

@ -38,14 +38,15 @@ namespace :saucy do
list[0]
end
addresses = sql_resultset_to_hashes('civicrm-dump/address.xml').select { |a| a["is_primary"] == "1" }
contacts = sql_resultset_to_hashes('civicrm-dump/contact.xml')
contributions = sql_resultset_to_hashes('civicrm-dump/contribution.xml')
emails = sql_resultset_to_hashes('civicrm-dump/email.xml').select { |a| a["is_primary"] == "1" }
memberships = sql_resultset_to_hashes('civicrm-dump/membership.xml').select { |m| Date.parse(m['end_date']).year >= 2020 }
payment_instruments = sql_resultset_to_hashes('civicrm-dump/payment_instrument.xml')
statuses = sql_resultset_to_hashes('civicrm-dump/status.xml')
types = sql_resultset_to_hashes('civicrm-dump/type.xml')
dir = ENV.fetch('CIVICRM_DUMP_DIRECTORY')
addresses = sql_resultset_to_hashes("#{dir}/address.xml").select { |a| a["is_primary"] == "1" }
contacts = sql_resultset_to_hashes("#{dir}/contact.xml")
contributions = sql_resultset_to_hashes("#{dir}/contribution.xml")
emails = sql_resultset_to_hashes("#{dir}/email.xml").select { |a| a["is_primary"] == "1" }
memberships = sql_resultset_to_hashes("#{dir}/membership.xml").select { |m| Date.parse(m['end_date']).year >= 2020 }
payment_instruments = sql_resultset_to_hashes("#{dir}/payment_instrument.xml")
statuses = sql_resultset_to_hashes("#{dir}/status.xml")
types = sql_resultset_to_hashes("#{dir}/type.xml")
members = contacts.map do |contact|