assign team to project from project page in public section
This commit is contained in:
parent
18bd1c9d30
commit
31d84d71d3
12 changed files with 129 additions and 3 deletions
|
@ -16,6 +16,8 @@ class UserTeam < ActiveRecord::Base
|
|||
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
|
||||
|
||||
scope :with_member, ->(user){ joins(:user_team_user_relationships).where(user_team_user_relationships: {user_id: user.id}) }
|
||||
scope :with_project, ->(project){ joins(:user_team_project_relationships).where(user_team_project_relationships: {project_id: project})}
|
||||
scope :without_project, ->(project){ where("id NOT IN (:ids)", ids: with_project(project))}
|
||||
scope :created_by, ->(user){ where(owner_id: user) }
|
||||
|
||||
class << self
|
||||
|
|
|
@ -10,6 +10,10 @@ class UserTeamProjectRelationship < ActiveRecord::Base
|
|||
|
||||
scope :with_project, ->(project){ where(project_id: project.id) }
|
||||
|
||||
def team_name
|
||||
user_team.name
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_greatest_access
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue