diff options
author | Long Nguyen <long.polyglot@gmail.com> | 2016-05-22 09:32:59 +0700 |
---|---|---|
committer | Long Nguyen <long.polyglot@gmail.com> | 2016-05-22 09:32:59 +0700 |
commit | 5af73808048a03a3a5e54f08bad1aeb1c74156cf (patch) | |
tree | a726e49f899e79c70531bae5c06d8390bf05d7fb /app | |
parent | f012c3de4c35cb420e8d1ad54fb6a729fb3e04fa (diff) | |
download | gitlab-ce-5af73808048a03a3a5e54f08bad1aeb1c74156cf.tar.gz |
Fix Member spec
Diffstat (limited to 'app')
-rw-r--r-- | app/models/members/project_member.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index fa04963a1b7..5c167db76b1 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -14,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 { user.todos.where(project_id: source_id).each(&:destroy) } + before_destroy { user.todos.where(project_id: source_id).each(&:destroy) if user } class << self |