Merge branch 'note-query-information' into 'master'

Note query information

See merge request !1149
This commit is contained in:
Stan Hu 2015-08-12 23:36:29 +00:00
commit 7d1c06793e
3 changed files with 15 additions and 2 deletions

View file

@ -360,6 +360,10 @@ class Note < ActiveRecord::Base
create_new_cross_references!(project, author) create_new_cross_references!(project, author)
end end
def system?
read_attribute(:system)
end
def editable? def editable?
!read_attribute(:system) !read_attribute(:system)
end end

View file

@ -31,7 +31,10 @@ Parameters:
"state": "active", "state": "active",
"created_at": "2013-09-30T13:46:01Z" "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, "id": 305,
@ -45,7 +48,10 @@ Parameters:
"state": "active", "state": "active",
"created_at": "2013-09-30T13:46:01Z" "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
} }
] ]
``` ```

View file

@ -205,6 +205,9 @@ module API
expose :attachment_identifier, as: :attachment expose :attachment_identifier, as: :attachment
expose :author, using: Entities::UserBasic expose :author, using: Entities::UserBasic
expose :created_at expose :created_at
expose :system?, as: :system
expose :upvote?, as: :upvote
expose :downvote?, as: :downvote
end end
class MRNote < Grape::Entity class MRNote < Grape::Entity