/
Dmitry-F
/
cbt_tool
Обзор
Документация
Войти
/
Dmitry-F
/
cbt_tool
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
python-ml-service
app/controllers/application_controller.rb
28 строк
711 B
Dmitriy-Filatov
fix(smer): починил работу движка в основном приложении
07 мар 2026, 20:43
07 мар 2026, 20:43
ff385aa
Код
Авторство
О чём код?
class ApplicationController < ActionController::Base before_action :set_current_therapist before_action :require_login helper_method :current_therapist rescue_from ActiveRecord::RecordNotFound, with: :not_found private def current_therapist @current_therapist ||= Therapist.find_by(id: session[:therapist_id]) end def set_current_therapist Current.therapist = current_therapist end def require_login unless current_therapist flash.keep[:alert] = "Требуется вход" if request.referer.present? redirect_to main_app.signin_path end end def not_found render file: "#{Rails.root}/public/404.html", status: :not_found, layout: false end end