Module: SpreeCmCommissioner::ApplicationControllerDecorator
- Defined in:
- app/controllers/spree_cm_commissioner/application_controller_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #after_sign_in_path_for(_) ⇒ Object
-
#set_writing_role(&block) ⇒ Object
Annonymous block: www.rubydoc.info/gems/rubocop/RuboCop/Cop/Naming/BlockForwarding.
Class Method Details
.prepended(base) ⇒ Object
3 4 5 6 |
# File 'app/controllers/spree_cm_commissioner/application_controller_decorator.rb', line 3 def self.prepended(base) base.include SpreeCmCommissioner::ExceptionNotificable base.include SpreeCmCommissioner::ContentCachable end |
Instance Method Details
#after_sign_in_path_for(_) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/spree_cm_commissioner/application_controller_decorator.rb', line 13 def after_sign_in_path_for(_) if spree_current_user.admin? admin_path elsif spree_current_user.organizer? && spree_current_user.events.present? event_guests_path(spree_current_user.events.first.slug) else '/' end end |
#set_writing_role(&block) ⇒ Object
Annonymous block: www.rubydoc.info/gems/rubocop/RuboCop/Cop/Naming/BlockForwarding
9 10 11 |
# File 'app/controllers/spree_cm_commissioner/application_controller_decorator.rb', line 9 def set_writing_role(&block) ActiveRecord::Base.connected_to(role: :writing, &block) end |