Sha256: af9f8ab7fd99b6c44de1b5b495991a2c82b9bd3db553da7859943703c3a4c20c

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

class ExportController < ArtfullyOseController

  def contacts
    @organization = current_user.current_organization
    @filename = "Artfully-People-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @csv_string = @organization.people.includes(:tags, :phones, :address).all.to_comma
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

  #
  # Artful.ly generates these nightly and provides links directly to s3
  #
  def donations
    @organization = current_user.current_organization
    @filename = "Artfully-Donations-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @items = ItemView.where(:organization_id => current_organization).where(:product_type => "Donation").all
    @csv_string = @items.to_comma(:donation)  
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

  #
  # Artful.ly generates these nightly and provides links directly to s3
  #
  def ticket_sales
    @organization = current_user.current_organization
    @filename = "Artfully-Ticket-Sales-Export-#{DateTime.now.strftime("%m-%d-%y")}.csv"
    @items = ItemView.where(:organization_id => current_organization).where(:product_type => "Ticket").all
    @csv_string = @items.to_comma(:ticket_sale)    
    send_data @csv_string, :filename => @filename, :type => "text/csv", :disposition => "attachment"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/controllers/export_controller.rb
artfully_ose-1.2.0.beta.1 app/controllers/export_controller.rb
artfully_ose-1.2.0.alpha.2 app/controllers/export_controller.rb
artfully_ose-1.2.0.alpha.1 app/controllers/export_controller.rb