diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2019-05-24 15:14:19 +0700 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2019-05-24 15:14:19 +0700 |
commit | dac520aa5771d942f5371d6ef3e38ea4838ae2c9 (patch) | |
tree | 24f0407f1e5bf9c0786220c9c70dbc4f923dd381 /app | |
parent | 36e15a866df5ca70e9c8209925acad412f2c6538 (diff) | |
download | gitlab-ce-dac520aa5771d942f5371d6ef3e38ea4838ae2c9.tar.gz |
Adds Identity#for_user for use in an EE MRce-jej/group-saml-cleans-up-identity
Diffstat (limited to 'app')
-rw-r--r-- | app/models/identity.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/identity.rb b/app/models/identity.rb index 8322b9bf35f..1cbd50205ed 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -13,6 +13,7 @@ class Identity < ApplicationRecord before_save :ensure_normalized_extern_uid, if: :extern_uid_changed? after_destroy :clear_user_synced_attributes, if: :user_synced_attributes_metadata_from_provider? + scope :for_user, ->(user) { where(user: user) } scope :with_provider, ->(provider) { where(provider: provider) } scope :with_extern_uid, ->(provider, extern_uid) do iwhere(extern_uid: normalize_uid(provider, extern_uid)).with_provider(provider) |