Skip to content

Commit

Permalink
Force guest user to use the first available
Browse files Browse the repository at this point in the history
Should stop tons of guests being created. For Figgy we don't care about
saving non-logged in searches and things.
  • Loading branch information
tpendragon committed Mar 5, 2018
1 parent ad77760 commit 9ec625a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9ec625a

Please sign in to comment.