Add changelog and code refactor

This commit is contained in:
Long Nguyen 2016-05-30 22:32:07 +07:00
parent 41f8e6a4d7
commit aeb5262d42
2 changed files with 6 additions and 1 deletions

View file

@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.9.0 (unreleased)
- Fix issue todo not remove when leave project !4150 (Long Nguyen)
- Allow forking projects with restricted visibility level
- Improve note validation to prevent errors when creating invalid note via API
- Redesign navigation for project pages

View file

@ -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) if user }
before_destroy :delete_member_todos
class << self
@ -103,6 +103,10 @@ class ProjectMember < Member
private
def delete_member_todos
user.todos.where(project_id: source_id).destroy_all if user
end
def send_invite
notification_service.invite_project_member(self, @raw_invite_token)