Sha256: 12e9a8952f8294e603250870ef8532932d0f120e24e361a7d63d429c44cc0ace

Contents?: true

Size: 600 Bytes

Versions: 22

Compression:

Stored size: 600 Bytes

Contents

module Spree
  module Admin
    class PromotionCodeBatchesController < ResourceController
      belongs_to 'spree/promotion'

      create.after :build_promotion_code_batch

      def download
        require "csv"

        @promotion_code_batch = Spree::PromotionCodeBatch.find(
          params[:promotion_code_batch_id]
        )

        send_data(
          render_to_string,
          filename: "promotion-code-batch-list-#{@promotion_code_batch.id}.csv"
        )
      end

      private

      def build_promotion_code_batch
        @promotion_code_batch.process
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
solidus_backend-2.5.2 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.5.1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.5.0 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.5.0.rc1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.5.0.beta2 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.5.0.beta1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.4.2 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.4.1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.2.2 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.4.0 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.4.0.rc1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.4.0.beta1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.0 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.0.rc3 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.0.rc2 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.0.rc1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.3.0.beta1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.2.1 app/controllers/spree/admin/promotion_code_batches_controller.rb
solidus_backend-2.2.0 app/controllers/spree/admin/promotion_code_batches_controller.rb