Class: Store::StoreController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Store::StoreController
- Includes:
- CartFinder
- Defined in:
- app/controllers/store/store_controller.rb
Direct Known Subclasses
Members::MembersController, CheckoutsController, DonationsController, EventsController, MembershipsController, OrdersController, PassesController, RetrievalsController, ShowsController
Instance Method Summary collapse
-
#load_store_organization ⇒ Object
Raises ActionController::RoutingError if a bad organization_slug is passed.
- #store_organization ⇒ Object
Methods included from CartFinder
#cart_name, #create_new_cart, #current_box_office_cart, #current_cart, #current_cart=, #current_sales_console_cart, #session_cart, #session_key
Instance Method Details
#load_store_organization ⇒ Object
Raises ActionController::RoutingError if a bad organization_slug is passed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/store/store_controller.rb', line 13 def load_store_organization if params[:organization_slug].present? org = Organization.find_using_slug(params[:organization_slug]) raise ActionController::RoutingError.new("Not Found") if org.nil? org elsif params[:controller].end_with? "events" Event.find(params[:id]).organization elsif params[:controller].end_with? "shows" Show.where(:uuid => params[:id]).first.organization elsif current_member current_member.organization else nil end end |
#store_organization ⇒ Object
6 7 8 |
# File 'app/controllers/store/store_controller.rb', line 6 def store_organization @store_organization ||= load_store_organization end |