From 9ec625ad63b5c7be97f511098061e372b6e18191 Mon Sep 17 00:00:00 2001 From: Trey Pendragon Date: Mon, 5 Mar 2018 11:51:37 -0800 Subject: [PATCH] Force guest user to use the first available Should stop tons of guests being created. For Figgy we don't care about saving non-logged in searches and things. --- app/controllers/application_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 42a977f009..80d19e8dd3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -27,4 +27,8 @@ def deny_resource_access(exception) end end end + + def guest_user + @guest_user ||= User.where(guest: true).first || super + end end