Commit 5af73808 authored by Long Nguyen's avatar Long Nguyen

Fix Member spec

parent f012c3de
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment