parent
5ffc6974f0
commit
da38d8b585
@ -19,7 +19,8 @@ class User < ApplicationRecord
|
||||
|
||||
validates :email, presence: true, uniqueness: true,
|
||||
length: {maximum: type_for_attribute(:email).limit}
|
||||
validates :unconfirmed_email, length: {maximum: type_for_attribute(:unconfirmed_email).limit}
|
||||
validates :unconfirmed_email,
|
||||
length: {maximum: type_for_attribute(:unconfirmed_email).limit}
|
||||
|
||||
def to_s
|
||||
email
|
||||
|
@ -20,8 +20,14 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
devise_for :users, path: '', path_names: {registration: 'profile'},
|
||||
controllers: {registrations: :registrations}
|
||||
# Devise does not handle properly models that require database access during loading.
|
||||
# https://github.com/heartcombo/devise/issues/5786
|
||||
connection = ActiveRecord::Base.connection
|
||||
if connection.schema_version && connection.table_exists?(:users)
|
||||
devise_for :users, path: '', path_names: {registration: 'profile'},
|
||||
controllers: {registrations: :registrations}
|
||||
end
|
||||
|
||||
resources :users, only: [:index, :show, :update] do
|
||||
member { get :disguise }
|
||||
collection { get :revert }
|
||||
|
Loading…
x
Reference in New Issue
Block a user