Sha256: e303428b2a6fb885d71efac06f8707427b3b0216c19fdf14c7de64e0a65beeff

Contents?: true

Size: 900 Bytes

Versions: 6

Compression:

Stored size: 900 Bytes

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

  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

  def ticket_sales
    # Moved to s3. Generated nightly with rake csv:sales
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.27 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.26 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.24 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.23 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.21 app/controllers/export_controller.rb
artfully_ose-1.2.0.pre.20 app/controllers/export_controller.rb