summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-03-27 18:03:50 +0100
committerPeter Leitzen <pleitzen@gitlab.com>2019-04-12 11:45:33 +0200
commitf1d59cf36d1721bee2dba4cac82346b173056489 (patch)
tree15466e8b644d3d15c08d047d29274681e5f0a02e
parent026c92d5fa82fac87386d5691c3d5b1e02f2eb5e (diff)
downloadgitlab-ce-pl-user-bot_type-ce.tar.gz
Remove User#internal_attributes methodpl-user-bot_type-ce
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
#