app/helpers/service_manager_sessions_helper.rb
def current_service_manager
        if (service_manager_id = session[:service_manager_id])
            @current_service_manager ||= ServiceManager.find_by(id: session[:service_manager_id])
        elsif (service_manager_id = cookies.signed[:service_manager_id])
            service_manager = ServiceManager.find_by(id: service_manager_id)
            if service_manager && service_manager.authenticated?(cookies[:remember_token])
                service_manager_log_in service_manager
                @current_service_manager = service_manager 
            end
        end
    end
# Returns the current logged-in service manager (if any).
Returns the current logged-in service manager (if any).
Returns the current logged - in service manager ( if any ) .
def current_service_manager
        if (service_manager_id = session[:service_manager_id])
            @current_service_manager ||= ServiceManager.find_by(id: session[:service_manager_id])
        elsif (service_manager_id = cookies.signed[:service_manager_id])
            service_manager = ServiceManager.find_by(id: service_manager_id)
            if service_manager && service_manager.authenticated?(cookies[:remember_token])
                service_manager_log_in service_manager
                @current_service_manager = service_manager 
            end
        end
    end
def current_service_manager if ( service_manager_id = session [ :service_manager_id ] ) @current_service_manager ||= ServiceManager . find_by ( id : session [ :service_manager_id ] ) elsif ( service_manager_id = cookies . signed [ :service_manager_id ] ) service_manager = ServiceManager . find_by ( id : service_manager_id ) if service_manager && service_manager . authenticated? ( cookies [ :remember_token ] ) service_manager_log_in service_manager @current_service_manager = service_manager end end end
Returns the current logged-in service manager (if any).
Returns the current logged - in service manager ( if any ) .