Add validation for uid uniqness [GIOT-29]

This commit is contained in:
Oleksii Kriuchykhin 2017-09-01 17:00:13 +02:00
parent 91233a97c4
commit fc0e2d2172

View file

@ -1,4 +1,5 @@
class UserIdentity < ActiveRecord::Base
belongs_to :user
validates :provider, uniqueness: { scope: :user_id }
validates :uid, uniqueness: { scope: :provider }
end