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.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 520baf6e659..1081f103ea6 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -354,8 +354,20 @@ class User < ActiveRecord::Base
end
end
+ def self.internal_attributes
+ [:ghost]
+ end
+
def internal?
- ghost?
+ self.class.internal_attributes.any? { |a| self[a] }
+ end
+
+ def self.internal
+ where(Hash[internal_attributes.zip([true] * internal_attributes.size)])
+ end
+
+ def self.non_internal
+ where(Hash[internal_attributes.zip([false] * internal_attributes.size)])
end
#