Fix mispelling and ambiguous id in UserTeam.without_project

This commit is contained in:
Dmitriy Zaporozhets 2013-01-24 11:19:09 +02:00
parent ca105d0462
commit ca752e64fb
8 changed files with 6 additions and 13 deletions

View file

@ -17,7 +17,7 @@ class UserTeam < ActiveRecord::Base
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: (a = with_project(project); a.blank? ? 0 : a))}
scope :without_project, ->(project){ where("user_teams.id NOT IN (:ids)", ids: (a = with_project(project); a.blank? ? 0 : a))}
scope :created_by, ->(user){ where(owner_id: user) }
class << self