Module: Comable::SigninAction
- Included in:
- OrdersController
- Defined in:
- app/controllers/concerns/comable/signin_action.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.prepended(base) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/controllers/concerns/comable/signin_action.rb', line 4 def prepended(base) base.instance_eval do before_filter :ensure_signed_in_or_guest, except: [:signin, :guest] helper_method :resource helper_method :resource_name helper_method :devise_mapping end end |
Instance Method Details
#guest ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/controllers/concerns/comable/signin_action.rb', line 15 def guest if @order.state?(:cart) ? @order.next_state : @order.save redirect_to next_order_path else render :signin end end |