Skip to content

Instantly share code, notes, and snippets.

@talum
Last active November 10, 2016 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talum/08c5b4e3dc4fa96965ea34fa4a41d84d to your computer and use it in GitHub Desktop.
Save talum/08c5b4e3dc4fa96965ea34fa4a41d84d to your computer and use it in GitHub Desktop.
cpb_admissions_csv
file = "#{Rails.root}/tmp/#{Date.current}-cpb-admissions-list.csv"
CSV.open(file, 'w') do |csv|
csv << ["name", "hubspot_link", "enrollment program", "payment plan", "enrollment status", "salesforce contact link", "admission decision"]
CpbApplication.all.joins(:user).order(reviewed_at: :desc).each do |cpb_application|
cpb_presenter = CpbApplicationReviewPresenter.new(cpb_application)
csv << [cpb_presenter.name, cpb_presenter.hubspot_profile_link, cpb_presenter.enrollment_program, cpb_presenter.enrollment_payment_plan, cpb_presenter.enrollment_status, cpb_presenter.salesforce_contact_link, cpb_application.user.program_admissions.where(program_id: 'community_powered_bootcamp').first.try(:status)]
end
end
to download:
scp user@staginghostname:remote_file_name local_file_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment