parent
80f576a29b
commit
3c4f32a760
2 changed files with 7 additions and 0 deletions
|
@ -104,6 +104,8 @@ class User < ApplicationRecord
|
|||
validates :preferred_editor, :inclusion => Editors::ALL_EDITORS, :allow_nil => true
|
||||
validates :auth_uid, :unless => proc { |u| u.auth_provider.nil? },
|
||||
:uniqueness => { :scope => :auth_provider }
|
||||
validates :avatar, :if => proc { |u| u.attachment_changes["avatar"] },
|
||||
:image => true
|
||||
|
||||
validates_email_format_of :email, :if => proc { |u| u.email_changed? }
|
||||
validates_email_format_of :new_email, :allow_blank => true, :if => proc { |u| u.new_email_changed? }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue