The second way works. So we'll go with that.

This commit is contained in:
2024-05-14 20:08:36 +01:00
parent be035f9e31
commit 8f9145ba54
2 changed files with 5 additions and 18 deletions

View File

@@ -1,17 +0,0 @@
class RegistrationsController < Devise::RegistrationsController
before_action :one_user_registered, only: [:new, :create]
protected
def one_user_registered
if User.count == 1
if user_signed_in?
redirect_to root_path
else
redirect_to new_user_session_path
end
end
end
end