Sha256: c8c578bd7668d2b1f2a6a56dac3161d067c14f6b6c138a2cba04a5e5453b47dc

Contents?: true

Size: 685 Bytes

Versions: 13

Compression:

Stored size: 685 Bytes

Contents

class Admin::ReturnAuthorizationsController < Admin::BaseController
  resource_controller
  belongs_to :order

  update.wants.html { redirect_to collection_url }
  create.wants.html { redirect_to collection_url }
  destroy.success.wants.js { render_js_for_destroy }

  update.after :associate_inventory_units
  create.after :associate_inventory_units

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

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spree_core-0.30.2 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.40.4 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.50.4 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.50.3 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.50.2 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.50.1 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.50.0 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.40.3 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.40.2 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.40.1 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.40.0 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.30.1 app/controllers/admin/return_authorizations_controller.rb
spree_core-0.30.0 app/controllers/admin/return_authorizations_controller.rb