Sha256: f530d5d56e7fe5cd0273d6988c5793768d3205bc753cbaacfe20a54bf221b8fc

Contents?: true

Size: 669 Bytes

Versions: 11

Compression:

Stored size: 669 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.notice = t(:return_authorization_updated)
        respond_with(@return_authorization) { |format| format.html { 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

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.6 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.4 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.3 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.2 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.1 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.0 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.0.rc4 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.0.rc3 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.0.rc2 app/controllers/spree/admin/return_authorizations_controller.rb
spree_core-1.0.0.rc1 app/controllers/spree/admin/return_authorizations_controller.rb