Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-07-06 18:25:54 +0300
committerDouwe Maan <douwe@gitlab.com>2016-07-06 18:25:54 +0300
commitb5b17d00eddef8011e3a71d5f4ad46c6d40cbf8a (patch)
treee1fe97b1c34be156f1b29a0013273f886c859a83 /app
parent0742b65203019cd1164bc8eb7c357439861d91b6 (diff)
parent19e15ae244776d4d148e6a65a1443f94bb59398c (diff)
Merge branch '19092-fix-event-for-legacydiffnote-not-considered-note' into 'master'
Fix diff comments not showing up in activity feed ## What does this MR do? It fixes the detection of note events to check for `Note` and `LegacyDiffNote`. ## Are there points in the code the reviewer needs to double check? No? /cc @DouweM (since I believe you introduced `LegacyDiffNote` ## Why was this MR needed? To fix #19092. ## What are the relevant issue numbers? Fixes #19092. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5069
Diffstat (limited to 'app')
-rw-r--r--app/models/event.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index d7d23c7ae6d..fd736d12359 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -67,7 +67,7 @@ class Event < ActiveRecord::Base
elsif issue? || issue_note?
Ability.abilities.allowed?(user, :read_issue, note? ? note_target : target)
else
- ((merge_request? || note?) && target) || milestone?
+ ((merge_request? || note?) && target.present?) || milestone?
end
end
@@ -136,7 +136,7 @@ class Event < ActiveRecord::Base
end
def note?
- target_type == "Note"
+ target.is_a?(Note)
end
def issue?