Last active
November 10, 2016 23:12
-
-
Save talum/08c5b4e3dc4fa96965ea34fa4a41d84d to your computer and use it in GitHub Desktop.
cpb_admissions_csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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