Files
fizzy/app/controllers/sessions/menus_controller.rb
T
Mike Dalessio d41d50d52b Account.sole → Current.account
and some other de-tenant changes, including removing the controller
tenanting concerns
2025-11-17 09:11:40 -05:00

23 lines
544 B
Ruby

class Sessions::MenusController < ApplicationController
before_action(if: :render_as_menu_section?) { request.variant = :menu_section }
layout "public"
def show
@memberships = Current.identity.memberships
if params[:without]
@memberships = @memberships.where.not(tenant: params[:without])
end
if @memberships.one? && !render_as_menu_section?
redirect_to root_url(script_name: "/#{@memberships.first.tenant}")
end
end
private
def render_as_menu_section?
params[:menu_section]
end
end