Sha256: 548812dff9dc24955d9fa959d1aa5f87b55bedbba8e2aed79f9f5acf181f428a

Contents?: true

Size: 553 Bytes

Versions: 8

Compression:

Stored size: 553 Bytes

Contents

class Admin::PromotionsController < Admin::ResourceController
  before_filter :load_data

  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
    edit_admin_promotion_url(@promotion)
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spree_promo-0.70.7 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.6 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.5 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.4 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.3 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.2 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.1 app/controllers/admin/promotions_controller.rb
spree_promo-0.70.0 app/controllers/admin/promotions_controller.rb