We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2befa8f commit 1a917bcCopy full SHA for 1a917bc
app/models/user_team.rb
@@ -17,7 +17,7 @@ class UserTeam < ActiveRecord::Base
17
18
scope :with_member, ->(user){ joins(:user_team_user_relationships).where(user_team_user_relationships: {user_id: user.id}) }
19
scope :with_project, ->(project){ joins(:user_team_project_relationships).where(user_team_project_relationships: {project_id: project})}
20
- scope :without_project, ->(project){ where("id NOT IN (:ids)", ids: with_project(project))}
+ scope :without_project, ->(project){ where("id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))}
21
scope :created_by, ->(user){ where(owner_id: user) }
22
23
class << self
0 commit comments