BigW Consortium Gitlab

identity.rb 484 Bytes
Newer Older
Dmitriy Zaporozhets committed
1 2 3 4 5 6 7 8
# == Schema Information
#
# Table name: identities
#
#  id         :integer          not null, primary key
#  extern_uid :string(255)
#  provider   :string(255)
#  user_id    :integer
9 10
#  created_at :datetime
#  updated_at :datetime
Dmitriy Zaporozhets committed
11 12
#

13
class Identity < ActiveRecord::Base
14
  include Sortable
15 16
  belongs_to :user

17
  validates :provider, presence: true
18
  validates :extern_uid, allow_blank: true, uniqueness: { scope: :provider }
Valery Sizov committed
19
  validates :user_id, uniqueness: { scope: :provider }
Dmitriy Zaporozhets committed
20
end