summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/project.rb1
-rw-r--r--spec/models/project_spec.rb8
2 files changed, 9 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 507228606df..ecd742a17d5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -380,6 +380,7 @@ class Project < ActiveRecord::Base
SELECT project_id, COUNT(*) AS amount
FROM notes
WHERE created_at >= #{sanitize(since)}
+ AND system IS FALSE
GROUP BY project_id
) join_note_counts ON projects.id = join_note_counts.project_id"
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index ef854a25321..1a316176f63 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -826,6 +826,14 @@ describe Project, models: true do
expect(subject).to eq([project2, project1])
end
end
+
+ it 'does not take system notes into account' do
+ 10.times do
+ create(:note_on_commit, project: project2, system: true)
+ end
+
+ expect(described_class.trending.to_a).to eq([project1, project2])
+ end
end
describe '.visible_to_user' do