diff options
author | Robert Speicher <robert@gitlab.com> | 2015-11-22 06:45:15 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-11-22 06:45:15 +0300 |
commit | b166ee6b1d6113642388bd5dc1b95fb53fc69d7b (patch) | |
tree | 26a332bf4fddaa5ba6f02b1268d9689df9b85154 /app | |
parent | 9155c82fdc075b7a3ef7f45224cbe5382c2ec7f9 (diff) | |
parent | 26b12e2c374c8f07abda06a8b19bd116448325f4 (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.rb | 10 | ||||
-rw-r--r-- | app/models/note.rb | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 2dafb5e752f..98ad5e76da7 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -92,6 +92,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 |