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:
authorRobert Speicher <robert@gitlab.com>2015-11-22 06:45:15 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-11-22 06:46:18 +0300
commit94b33caf8488d98f49ff3c1b468d3e0327135bc4 (patch)
tree05648706b9b6b90b6fee282e9884b5370d753a7b /app
parent27821ce01fde7e5b3dfce243e22894b44aa2a81d (diff)
Merge branch 'fix-award-emoji-api' into 'master'
Add upvote/downvote fields to merge request and note API to preserve compatibility As discussed in !1825 we should not break the API compatibility. * This MR adds the fields `upvotes`/`downvotes` to the merge request API again, which always return `0`. * Add the fields `upvote`/`downvote` to the notes API, which always return `false` This behavior is documented in the API docs. See merge request !1867
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/issuable.rb10
-rw-r--r--app/models/note.rb10
2 files changed, 20 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 91da6797df7..b54145ba1b0 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -89,6 +89,16 @@ module Issuable
opened? || reopened?
end
+ # Deprecated. Still exists to preserve API compatibility.
+ def downvotes
+ 0
+ end
+
+ # Deprecated. Still exists to preserve API compatibility.
+ def upvotes
+ 0
+ end
+
def subscribed?(user)
subscription = subscriptions.find_by_user_id(user.id)
diff --git a/app/models/note.rb b/app/models/note.rb
index e30be444eb5..1c6345e735c 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -335,6 +335,16 @@ class Note < ActiveRecord::Base
read_attribute(:system)
end
+ # Deprecated. Still exists to preserve API compatibility.
+ def downvote?
+ false
+ end
+
+ # Deprecated. Still exists to preserve API compatibility.
+ def upvote?
+ false
+ end
+
def editable?
!system?
end