Class: Admin::WholesalersController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::WholesalersController
- Includes:
- SpreeWholesale::WholesalerController
- Defined in:
- app/controllers/admin/wholesalers_controller.rb
Instance Method Summary collapse
Methods included from SpreeWholesale::WholesalerController
Instance Method Details
#approval_setup ⇒ Object
32 33 34 35 |
# File 'app/controllers/admin/wholesalers_controller.rb', line 32 def approval_setup @wholesaler = Wholesaler.find(params[:id]) @role = Role.find_by_name("wholesaler") end |
#approve ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/admin/wholesalers_controller.rb', line 20 def approve return redirect_to request.referer, :flash => { :error => "Wholesaler is already active." } if @wholesaler.active? @wholesaler.activate! redirect_to request.referer, :flash => { :notice => "Wholesaler was successfully approved." } end |
#reject ⇒ Object
26 27 28 29 30 |
# File 'app/controllers/admin/wholesalers_controller.rb', line 26 def reject return redirect_to request.referer, :flash => { :error => "Wholesaler is already rejected." } unless @wholesaler.active? @wholesaler.deactivate! redirect_to request.referer, :flash => { :notice => "Wholesaler was successfully rejected." } end |