Parameterize civicrm dump directory

main
Hugo Peixoto 2 months ago
parent 0950c0dbb0
commit 897b48e377
  1. 17
      lib/tasks/saucy.rake

@ -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|

Loading…
Cancel
Save