summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-02-14 19:09:52 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-02-14 19:09:52 +0000
commitefc82ebf3f7378f848b65c0a45a4052316bfd6db (patch)
treee5df1ae3557663b5584b6488b6db7e9a1a03ef33 /app/models
parent6676b4f0dd05ffb6071a3329cca4459e7cddcdc3 (diff)
parentad5e772bddd7b417fa7a36629db02c69b1b9864d (diff)
downloadgitlab-ce-efc82ebf3f7378f848b65c0a45a4052316bfd6db.tar.gz
Merge branch 'master' into 'dz-nested-groups-improvements-3'
# Conflicts: # doc/api/projects.md
Diffstat (limited to 'app/models')
-rw-r--r--app/models/event.rb7
-rw-r--r--app/models/wiki_page.rb4
2 files changed, 8 insertions, 3 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index cf89ac5207f..e5027df3f8a 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -45,9 +45,10 @@ class Event < ActiveRecord::Base
class << self
# Update Gitlab::ContributionsCalendar#activity_dates if this changes
def contributions
- where("action = ? OR (target_type in (?) AND action in (?))",
- Event::PUSHED, ["MergeRequest", "Issue"],
- [Event::CREATED, Event::CLOSED, Event::MERGED])
+ where("action = ? OR (target_type IN (?) AND action IN (?)) OR (target_type = ? AND action = ?)",
+ Event::PUSHED,
+ ["MergeRequest", "Issue"], [Event::CREATED, Event::CLOSED, Event::MERGED],
+ "Note", Event::COMMENTED)
end
def limit_recent(limit = 20, offset = nil)
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 6347b274341..2caebb496db 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -207,6 +207,10 @@ class WikiPage
'projects/wikis/wiki_page'
end
+ def id
+ page.version.to_s
+ end
+
private
def set_attributes