spec/dummy/app/controllers/application_controller.rb in aaf-gumboot-1.0.0.pre.alpha.2 vs spec/dummy/app/controllers/application_controller.rb in aaf-gumboot-1.1.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base Forbidden = Class.new(StandardError) private_constant :Forbidden rescue_from Forbidden, with: :forbidden @@ -10,10 +12,10 @@ protect_from_forgery with: :exception before_action :ensure_authenticated after_action :ensure_access_checked def subject - subject = session[:subject_id] && Subject.find_by_id(session[:subject_id]) + subject = session[:subject_id] && Subject.find_by(id: session[:subject_id]) return nil unless subject.try(:functioning?) @subject = subject end protected