I was googling but couldn’t find any examples of using Devise and Null Object pattern. I just want to check if anyone else sees a potential problem with the code below. Here’s what I came up with:
# application_controller.rb def current_user @current_user ||= warden.authenticate(scope: :user) || Guest.new end
This way no other changes are required in the controller/view layer (you still refer to current_user as before).
Thanks for your thoughts.