authorized_for scope added to project
This commit is contained in:
parent
15a72a3b87
commit
34c2d8e82e
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue