Sha256: bae00bef75dc6de592dea845b5e8591dcad3a852b3954577a614ad3cfd262835

Contents?: true

Size: 446 Bytes

Versions: 2

Compression:

Stored size: 446 Bytes

Contents

Spree::Admin::ProductsController.class_eval do
  
  def deletefc
    inorout(@product.method :delfrom)
  end
  
  def backtocountry
    inorout(@product.method :backtocountry)
  end

protected

  def inorout(m)
    country = session[:zoned] && session[:zoned][:prd_country]
    m.call(country.to_i) if country
    respond_to do |format|
      format.html { redirect_to collection_url }
      format.js { render nothing: true }
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_zoned-0.5.12 app/controllers/spree/admin/products_controller_decorator.rb
spree_zoned-0.5.11 app/controllers/spree/admin/products_controller_decorator.rb