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:
authorPeter Leitzen <pleitzen@gitlab.com>2019-04-12 15:16:06 +0300
committerSean McGivern <sean@gitlab.com>2019-04-12 15:16:06 +0300
commita69f889101b9feacd6ac55ebf7e3c6334abb792f (patch)
treea07b9a75add0a2bb21278d61d1cb5047765c5f0a
parent7457c1e1229cd1e90e608e8b247e2fbb217f05b6 (diff)
Remove User#internal_attributes method
It's not needed anymore as we've replaced boolean `support_bot` with enum `bot_type`.
-rw-r--r--app/models/user.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index d3524bfd6ae..b08ac638949 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -537,20 +537,16 @@ class User < ApplicationRecord
username
end
- def self.internal_attributes
- [:ghost]
- end
-
def internal?
- self.class.internal_attributes.any? { |a| self[a] }
+ ghost?
end
def self.internal
- where(Hash[internal_attributes.zip([true] * internal_attributes.size)])
+ where(ghost: true)
end
def self.non_internal
- where(internal_attributes.map { |attr| "#{attr} IS NOT TRUE" }.join(" AND "))
+ where('ghost IS NOT TRUE')
end
#