summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-02-14 11:18:40 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-02-14 11:18:40 +0000
commit478e01ce7b38cdbdff8bd2b7138abd31cf1c37f9 (patch)
tree7674f1313bc9a1b0d12b2687680ae368b7fa0887 /lib
parent640e977d4d5b6ab8f0c48f3b58a14ed2301d8257 (diff)
parent4f51e1fad0609c0cd50468243a83970728186a8e (diff)
downloadgitlab-ce-478e01ce7b38cdbdff8bd2b7138abd31cf1c37f9.tar.gz
Merge branch '22645-add-discussion-contribs-to-calendar' into 'master'
Add discussion events to contributions calendar Closes #22645 See merge request !8821
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/contributions_calendar.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/contributions_calendar.rb b/lib/gitlab/contributions_calendar.rb
index 7e3d5647b39..15992b77680 100644
--- a/lib/gitlab/contributions_calendar.rb
+++ b/lib/gitlab/contributions_calendar.rb
@@ -22,8 +22,10 @@ module Gitlab
having(action: [Event::CREATED, Event::CLOSED], target_type: "Issue")
mr_events = event_counts(date_from, :merge_requests).
having(action: [Event::MERGED, Event::CREATED, Event::CLOSED], target_type: "MergeRequest")
+ note_events = event_counts(date_from, :merge_requests).
+ having(action: [Event::COMMENTED], target_type: "Note")
- union = Gitlab::SQL::Union.new([repo_events, issue_events, mr_events])
+ union = Gitlab::SQL::Union.new([repo_events, issue_events, mr_events, note_events])
events = Event.find_by_sql(union.to_sql).map(&:attributes)
@activity_events = events.each_with_object(Hash.new {|h, k| h[k] = 0 }) do |event, activities|
@@ -38,7 +40,7 @@ module Gitlab
# Use visible_to_user? instead of the complicated logic in activity_dates
# because we're only viewing the events for a single day.
- events.select {|event| event.visible_to_user?(current_user) }
+ events.select { |event| event.visible_to_user?(current_user) }
end
def starting_year