Try a different method of stopping sign_ups
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
|
||||
before_action :one_user_registered?, only: [:new, :create]
|
||||
before_action :one_user_registered, only: [:new, :create]
|
||||
|
||||
protected
|
||||
|
||||
def one_user_registered?
|
||||
def one_user_registered
|
||||
if User.count == 1
|
||||
if user_signed_in?
|
||||
redirect_to root_path
|
||||
|
||||
Reference in New Issue
Block a user