parent
5ffc6974f0
commit
da38d8b585
@ -19,7 +19,8 @@ class User < ApplicationRecord
|
|||||||
|
|
||||||
validates :email, presence: true, uniqueness: true,
|
validates :email, presence: true, uniqueness: true,
|
||||||
length: {maximum: type_for_attribute(:email).limit}
|
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
|
def to_s
|
||||||
email
|
email
|
||||||
|
@ -20,8 +20,14 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
devise_for :users, path: '', path_names: {registration: 'profile'},
|
# Devise does not handle properly models that require database access during loading.
|
||||||
controllers: {registrations: :registrations}
|
# 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
|
resources :users, only: [:index, :show, :update] do
|
||||||
member { get :disguise }
|
member { get :disguise }
|
||||||
collection { get :revert }
|
collection { get :revert }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user