diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/models/member.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 498e03b2c1a..687830f5267 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -96,6 +96,8 @@ class Member < ApplicationRecord scope :owners, -> { active.where(access_level: OWNER) } scope :owners_and_maintainers, -> { active.where(access_level: [OWNER, MAINTAINER]) } scope :with_user, -> (user) { where(user: user) } + scope :with_user_by_email, -> (email) { left_join_users.where(users: { email: email } ) } + scope :preload_user_and_notification_settings, -> { preload(user: :notification_settings) } scope :with_source_id, ->(source_id) { where(source_id: source_id) } @@ -417,6 +419,10 @@ class Member < ApplicationRecord invite? && user_id.nil? end + def created_by_name + created_by&.name + end + private def send_invite |