diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-05 20:37:35 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-05 20:37:35 +0300 |
commit | 0fdce4a52b1a9ba9e0efd98f00e558e4f07daeb5 (patch) | |
tree | 9305a29f92c3d6763d6b7038ac65a71ec67e087e /app/models/group.rb | |
parent | 4ca6ebf017e93686ee885ee1a28dc5c6934c9d39 (diff) | |
download | gitlab-ce-0fdce4a52b1a9ba9e0efd98f00e558e4f07daeb5.tar.gz |
Refactor some search scopes to prevent wierd behaviour and PG::Error issues
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 2e68779d367..e51e19ab60c 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -27,12 +27,6 @@ class Group < Namespace mount_uploader :avatar, AttachmentUploader - def self.accessible_to(user) - accessible_ids = Project.accessible_to(user).pluck(:namespace_id) - accessible_ids += user.groups.pluck(:id) if user - where(id: accessible_ids) - end - def human_name name end @@ -77,4 +71,8 @@ class Group < Namespace self.errors.add :avatar, "only images allowed" end end + + def public_profile? + projects.public_only.any? + end end |