提交 f9cf04fe 编写于 作者: S Sean McGivern

Merge branch 'pl-user-bot_type-ce' into 'master'

CE Backport: Refactor Service Desk's bot user

See merge request gitlab-org/gitlab-ce!26671
......@@ -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
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册