Sha256: dac953d34003d8da9d1ab31040daeb95f389fa4a4708e5107f23b1ff1eadc8cc

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module Spree
  module Admin
    class VolumePriceModelsController < ResourceController

      before_action :load_volume_prices, only: [:new, :edit]

      private

      def location_after_save
        if @volume_price_model.created_at == @volume_price_model.updated_at
          edit_admin_volume_price_model_url(@volume_price_model)
        else
          admin_volume_price_models_url
        end
      end

      def load_volume_prices
        @volume_price_model.volume_prices.build if @volume_price_model.volume_prices.empty?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_volume_pricing-0.2.1 app/controllers/spree/admin/volume_price_models_controller.rb
solidus_volume_pricing-0.1.1 app/controllers/spree/admin/volume_price_models_controller.rb