Class: Front::Devise::SessionsController
- Inherits:
-
Devise::SessionsController
- Object
- Devise::SessionsController
- Front::Devise::SessionsController
- Defined in:
- app/controllers/c/front/devise/sessions_controller.rb
Instance Method Summary collapse
- #after_login ⇒ Object
- #after_sign_in_path_for(resource) ⇒ Object
- #after_sign_out_path_for(_resource_or_scope) ⇒ Object
Instance Method Details
#after_login ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/c/front/devise/sessions_controller.rb', line 7 def after_login return unless session[:cart_id].present? begin customer = current_front_customer_account.customer cart = C::Cart.find(session[:cart_id]) cart.update(customer_id: customer.id) cart.order.update(customer: customer) if cart.order.present? rescue ActiveRecord::RecordNotFound # Do nothing, as there is nothing to set end end |
#after_sign_in_path_for(resource) ⇒ Object
19 20 21 |
# File 'app/controllers/c/front/devise/sessions_controller.rb', line 19 def after_sign_in_path_for(resource) request[:checkout] ? new_checkout_path : super end |
#after_sign_out_path_for(_resource_or_scope) ⇒ Object
23 24 25 |
# File 'app/controllers/c/front/devise/sessions_controller.rb', line 23 def after_sign_out_path_for(_resource_or_scope) '/' end |