BigW Consortium Gitlab

identity.rb 328 Bytes
Newer Older
1
class Identity < ActiveRecord::Base
2
  include Sortable
3
  include CaseSensitivity
4 5
  belongs_to :user

6
  validates :provider, presence: true
7
  validates :extern_uid, allow_blank: true, uniqueness: { scope: :provider }
Valery Sizov committed
8
  validates :user_id, uniqueness: { scope: :provider }
9

Gabriel Mazetto committed
10
  def ldap?
11 12
    provider.starts_with?('ldap')
  end
Dmitriy Zaporozhets committed
13
end