Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb25
1 files changed, 8 insertions, 17 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 4a57cc2e2e2..9f85d41b133 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -2,7 +2,7 @@
require 'carrierwave/orm/activerecord'
-class User < ApplicationRecord
+class User < MainClusterwide::ApplicationRecord
extend Gitlab::ConfigHelper
include Gitlab::ConfigHelper
@@ -403,6 +403,7 @@ class User < ApplicationRecord
delegate :location, :location=, to: :user_detail, allow_nil: true
delegate :organization, :organization=, to: :user_detail, allow_nil: true
delegate :discord, :discord=, to: :user_detail, allow_nil: true
+ delegate :email_reset_offered_at, :email_reset_offered_at=, to: :user_detail, allow_nil: true
accepts_nested_attributes_for :user_preference, update_only: true
accepts_nested_attributes_for :user_detail, update_only: true
@@ -520,7 +521,11 @@ class User < ApplicationRecord
scope :active, -> { with_state(:active).non_internal }
scope :active_without_ghosts, -> { with_state(:active).without_ghosts }
scope :deactivated, -> { with_state(:deactivated).non_internal }
- scope :without_projects, -> { joins('LEFT JOIN project_authorizations ON users.id = project_authorizations.user_id').where(project_authorizations: { user_id: nil }) }
+ scope :without_projects, -> do
+ joins('LEFT JOIN project_authorizations ON users.id = project_authorizations.user_id')
+ .where(project_authorizations: { user_id: nil })
+ .allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/422045')
+ end
scope :by_username, -> (usernames) { iwhere(username: Array(usernames).map(&:to_s)) }
scope :by_name, -> (names) { iwhere(name: Array(names)) }
scope :by_login, -> (login) do
@@ -1765,13 +1770,7 @@ class User < ApplicationRecord
def following_users_allowed?(user)
return false if self.id == user.id
- following_users_enabled? && user.following_users_enabled?
- end
-
- def following_users_enabled?
- return true unless ::Feature.enabled?(:disable_follow_users, self)
-
- enabled_following
+ enabled_following && user.enabled_following
end
def forkable_namespaces
@@ -2192,14 +2191,6 @@ class User < ApplicationRecord
callout_dismissed?(callout, ignore_dismissal_earlier_than)
end
- def dismissed_callout_before?(feature_name, dismissed_before)
- callout = callouts_by_feature_name[feature_name]
-
- return false unless callout
-
- callout.dismissed_before?(dismissed_before)
- end
-
def dismissed_callout_for_group?(feature_name:, group:, ignore_dismissal_earlier_than: nil)
source_feature_name = "#{feature_name}_#{group.id}"
callout = group_callouts_by_feature_name[source_feature_name]