BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
95f8f7c7
Commit
95f8f7c7
authored
Aug 12, 2015
by
Ben Boeckel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: add 'system', 'upvote', and 'downvote' fields to note queries
This reverts commit
4c586dc7
.
parent
cd579cb2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
note.rb
app/models/note.rb
+4
-0
notes.md
doc/api/notes.md
+8
-2
entities.rb
lib/api/entities.rb
+3
-0
No files found.
app/models/note.rb
View file @
95f8f7c7
...
...
@@ -360,6 +360,10 @@ class Note < ActiveRecord::Base
create_new_cross_references!
(
project
,
author
)
end
def
system?
read_attribute
(
:system
)
end
def
editable?
!
read_attribute
(
:system
)
end
...
...
doc/api/notes.md
View file @
95f8f7c7
...
...
@@ -31,7 +31,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:22:45Z"
"created_at"
:
"2013-10-02T09:22:45Z"
,
"system"
:
true
,
"upvote"
:
false
,
"downvote"
:
false
},
{
"id"
:
305
,
...
...
@@ -45,7 +48,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:56:03Z"
"created_at"
:
"2013-10-02T09:56:03Z"
,
"system"
:
false
,
"upvote"
:
false
,
"downvote"
:
false
}
]
```
...
...
lib/api/entities.rb
View file @
95f8f7c7
...
...
@@ -205,6 +205,9 @@ module API
expose
:attachment_identifier
,
as: :attachment
expose
:author
,
using:
Entities
::
UserBasic
expose
:created_at
expose
:system?
,
as: :system
expose
:upvote?
,
as: :upvote
expose
:downvote?
,
as: :downvote
end
class
MRNote
<
Grape
::
Entity
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment