diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-06-21 09:24:03 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-03 10:34:44 +0300 |
commit | 7458ca8ebb093af93c01cb61dabca15fd0c995cb (patch) | |
tree | dd8adc950f0ac762c4236a5f81519b89edf4aec7 /app/services | |
parent | 57a44f2da3d2a0b59209b6c2d653d04efd0d3d41 (diff) |
[backend] Addressed review comments
* Group filtering now includes also issues/MRs from
subgroups/subprojects
* fixed due_date
* Also DRYed todo controller specs
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/todo_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index f355d6b8ea1..5a2460a0cf5 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -285,6 +285,7 @@ class TodoService def attributes_for_target(target) attributes = { project_id: target&.project&.id, + group_id: target.respond_to?(:group) ? target.group_id : nil, target_id: target.id, target_type: target.class.name, commit_id: nil @@ -300,7 +301,6 @@ class TodoService def attributes_for_todo(project, target, author, action, note = nil) attributes_for_target(target).merge!( project_id: project&.id, - group_id: target.respond_to?(:group) ? target.group.id : nil, author_id: author.id, action: action, note: note @@ -322,7 +322,7 @@ class TodoService end def reject_users_without_access(users, parent, target) - if target.is_a?(Note) && (target.for_issue? || target.for_merge_request? || target.for_epic?) + if target.is_a?(Note) && target.for_issuable_with_ability? target = target.noteable end |