Sha256: 5d8a452ca6e126f4c79354c84621d8c092a122bda74dc75bf9552595fd9f29b4

Contents?: true

Size: 621 Bytes

Versions: 57

Compression:

Stored size: 621 Bytes

Contents

module Spree
  module Admin
    class ReturnAuthorizationsController < ResourceController
      belongs_to 'spree/order', :find_by => :number

      update.after :associate_inventory_units
      create.after :associate_inventory_units

      def fire
        @return_authorization.send("#{params[:e]}!")
        flash[:success] = Spree.t(:return_authorization_updated)
        redirect_to :back
      end

      protected
        def associate_inventory_units
          (params[:return_quantity] || []).each { |variant_id, qty| @return_authorization.add_variant(variant_id.to_i, qty.to_i) }
        end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
spree_backend-2.3.13 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.14 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.12 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.13 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.11 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.12 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.10 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.9 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.11 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.10 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.8 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.7 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.9 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.1.12 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.6 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.8 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.1.11 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.3.5 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.2.7 app/controllers/spree/admin/return_authorizations_controller.rb
spree_backend-2.1.10 app/controllers/spree/admin/return_authorizations_controller.rb