diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-05-24 14:57:27 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-05-24 14:57:27 +0000 |
commit | c0ea4164cdc21e831fbbfa9dee48a6fa2766d9fc (patch) | |
tree | 3f8efb2a51477c9483e269e2b479b6a32e757db9 | |
parent | e7e0792a426a5e989b350ce5d98dd4930da85fb7 (diff) | |
parent | dac520aa5771d942f5371d6ef3e38ea4838ae2c9 (diff) | |
download | gitlab-ce-c0ea4164cdc21e831fbbfa9dee48a6fa2766d9fc.tar.gz |
Merge branch 'ce-jej/group-saml-cleans-up-identity' into 'master'
Adds Identity#for_user for use in an EE MR
See merge request gitlab-org/gitlab-ce!28697
-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) |