diff options
author | Long Nguyen <long.polyglot@gmail.com> | 2016-05-21 17:20:44 +0700 |
---|---|---|
committer | Long Nguyen <long.polyglot@gmail.com> | 2016-05-21 17:20:44 +0700 |
commit | bfbbb182c14441ad176b6c7b0ec9e9f38da25ae4 (patch) | |
tree | 07a099a7752819c84329a15e2e03143d30dd2d4c /app/models/members | |
parent | a263425ff14b3524751d41dc6ac74050a24b8609 (diff) | |
download | gitlab-ce-bfbbb182c14441ad176b6c7b0ec9e9f38da25ae4.tar.gz |
Fix broken specs
Diffstat (limited to 'app/models/members')
-rw-r--r-- | app/models/members/project_member.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 0ced9c31581..fa04963a1b7 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -3,7 +3,6 @@ class ProjectMember < Member include Gitlab::ShellAdapter - has_many :todos, through: :user belongs_to :project, class_name: 'Project', foreign_key: 'source_id' # Make sure project member points only to project as it source @@ -15,7 +14,7 @@ class ProjectMember < Member scope :in_projects, ->(projects) { where(source_id: projects.pluck(:id)) } scope :with_user, ->(user) { where(user_id: user.id) } - before_destroy { todos.each(&:destroy) } + before_destroy { user.todos.where(project_id: source_id).each(&:destroy) } class << self |