X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/00982e137f8b6034c73312ec6d029fd42d53f5fb..13c2ac5cdb7e5beddf80b90b0357b9961e12033f:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index e255dc216..a550b9f05 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -52,6 +52,8 @@ class User < ActiveRecord::Base validates :home_zoom, :allow_nil => true, :numericality => { :only_integer => true } validates :preferred_editor, :inclusion => Editors::ALL_EDITORS, :allow_nil => true validates :image, :attachment_content_type => { :content_type => %r{\Aimage/.*\Z} } + validates :auth_uid, :unless => proc { |u| u.auth_provider.nil? }, + :uniqueness => { :scope => :auth_provider } 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? }