Sha256: 42e0d8f32ba00553e424f21ea27b66c8aa9b732f57f47efd8cc2ce7e4663bc65

Contents?: true

Size: 712 Bytes

Versions: 9

Compression:

Stored size: 712 Bytes

Contents

module Spree
  module Admin
    class PromotionsController < ResourceController
      before_filter :load_data
      helper 'spree/promotion_rules'

      protected
        def build_resource
          @promotion = Promotion.new(params[:promotion])
          if params[:promotion] && params[:promotion][:calculator_type]
            @promotion.calculator = params[:promotion][:calculator_type].constantize.new
          end
          @promotion
        end

        def location_after_save
          spree.edit_admin_promotion_url(@promotion)
        end

        def load_data
          @calculators = Rails.application.config.spree.calculators.promotion_actions_create_adjustments
        end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree_promo-1.0.7 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.6 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.4 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.3 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.2 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.1 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.0 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.0.rc4 app/controllers/spree/admin/promotions_controller.rb
spree_promo-1.0.0.rc3 app/controllers/spree/admin/promotions_controller.rb