Sha256: 5112fdcaf05d3ba108d18e933ad70e1c1278f9793001dcf85cc52bf6d15e712b
Contents?: true
Size: 873 Bytes
Versions: 5
Compression:
Stored size: 873 Bytes
Contents
# frozen_string_literal: true module SolidusPromotions module Admin class PromotionCodeBatchesController < BaseController belongs_to "solidus_promotions/promotion" create.after :build_promotion_code_batch def download require "csv" @promotion_code_batch = SolidusPromotions::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 def model_class SolidusPromotions::PromotionCodeBatch end def collection parent.code_batches end def build_resource parent.code_batches.build end end end end
Version data entries
5 entries across 5 versions & 1 rubygems