diff options
author | Rémy Coutable <remy@rymai.me> | 2016-05-09 14:53:13 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-05-09 14:53:13 +0000 |
commit | 8dd2188b8367ad18bf005c855ef55f001a0b5fd1 (patch) | |
tree | a909599a09100b4f830f9560a3949a381a96ba47 /app/models | |
parent | d4d34b161b41539567332d45527bb10c9f0665e3 (diff) | |
parent | f5240f9703fea9902ac4304b8e12daed5c21820d (diff) | |
download | gitlab-ce-8dd2188b8367ad18bf005c855ef55f001a0b5fd1.tar.gz |
Merge branch '2954-api-expose-issue-user_notes_count' into 'master'
API: Expose Issue#user_notes_count and MergeRequest#user_notes_count
_Originally opened at !2954 by @cnam812._
- - -
Expose `Issue#user_notes_count` and `MergeRequest#user_notes_count` through the API.
See merge request !3126
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/issuable.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 2e4efc4e8d8..7a3db742030 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -160,6 +160,10 @@ module Issuable notes.awards.where(note: "thumbsup").count end + def user_notes_count + notes.user.count + end + def subscribed_without_subscriptions?(user) participants(user).include?(user) end |