app/helpers/facility_manager_sessions_helper.rb
# Returns the current logged-in facility manager (if any).
Returns the current logged-in facility manager (if any).
Returns the current logged - in facility manager ( if any ) .
def current_facility_manager
        if (facility_manager_id = session[:facility_manager_id])
            @current_facility_manager ||= FacilityManager.find_by(id: session[:facility_manager_id])
        elsif (facility_manager_id = cookies.signed[:facility_manager_id])
            facility_manager = FacilityManager.find_by(id: facility_manager_id)
            if facility_manager && facility_manager.authenticated?(cookies[:remember_token])
                facility_manager_log_in facility_manager
                @current_facility_manager = facility_manager 
            end
        end
    end
def current_facility_manager if ( facility_manager_id = session [ :facility_manager_id ] ) @current_facility_manager ||= FacilityManager . find_by ( id : session [ :facility_manager_id ] ) elsif ( facility_manager_id = cookies . signed [ :facility_manager_id ] ) facility_manager = FacilityManager . find_by ( id : facility_manager_id ) if facility_manager && facility_manager . authenticated? ( cookies [ :remember_token ] ) facility_manager_log_in facility_manager @current_facility_manager = facility_manager end end end
Returns the current logged-in facility manager (if any).
Returns the current logged - in facility manager ( if any ) .