mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-24 20:16:08 +10:00
authorized_for scope added to project
This commit is contained in:
@@ -73,6 +73,7 @@ class Project < ActiveRecord::Base
|
||||
scope :public_only, where(private_flag: false)
|
||||
scope :without_user, ->(user) { where("id NOT IN (:ids)", ids: user.projects.map(&:id) ) }
|
||||
scope :not_in_group, ->(group) { where("id NOT IN (:ids)", ids: group.project_ids ) }
|
||||
scope :authorized_for, ->(user) { joins(:users_projects) { where(user_id: user.id) } }
|
||||
|
||||
class << self
|
||||
def active
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
→
|
||||
%span.last_activity
|
||||
%strong Projects:
|
||||
%span= group.projects.count
|
||||
%span= group.projects.authorized_for(current_user).count
|
||||
|
||||
Reference in New Issue
Block a user