diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/api/notes.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-ce-tc-standard-gem.tar.gz |
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I
decided to try https://github.com/testdouble/standard on our codebase.
It's opinionated, but at least it's a _standard_.
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb index f7bd092ce50..2b4bcbc9aa2 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -23,11 +23,11 @@ module API success Entities::Note end params do - requires :noteable_id, type: Integer, desc: 'The ID of the noteable' - optional :order_by, type: String, values: %w[created_at updated_at], default: 'created_at', - desc: 'Return notes ordered by `created_at` or `updated_at` fields.' - optional :sort, type: String, values: %w[asc desc], default: 'desc', - desc: 'Return notes sorted in `asc` or `desc` order.' + requires :noteable_id, type: Integer, desc: "The ID of the noteable" + optional :order_by, type: String, values: %w[created_at updated_at], default: "created_at", + desc: "Return notes ordered by `created_at` or `updated_at` fields." + optional :sort, type: String, values: %w[asc desc], default: "desc", + desc: "Return notes sorted in `asc` or `desc` order." use :pagination end # rubocop: disable CodeReuse/ActiveRecord @@ -45,7 +45,7 @@ module API # mismatch between the pagination headers info and the actual notes # array returned, but this is really a edge-case. paginate(raw_notes) - .reject { |n| n.cross_reference_not_visible_for?(current_user) } + .reject { |n| n.cross_reference_not_visible_for?(current_user) } present notes, with: Entities::Note end # rubocop: enable CodeReuse/ActiveRecord @@ -54,8 +54,8 @@ module API success Entities::Note end params do - requires :note_id, type: Integer, desc: 'The ID of a note' - requires :noteable_id, type: Integer, desc: 'The ID of the noteable' + requires :note_id, type: Integer, desc: "The ID of a note" + requires :noteable_id, type: Integer, desc: "The ID of the noteable" end get ":id/#{noteables_str}/:noteable_id/notes/:note_id" do noteable = find_noteable(parent_type, noteables_str, params[:noteable_id]) @@ -66,9 +66,9 @@ module API success Entities::Note end params do - requires :noteable_id, type: Integer, desc: 'The ID of the noteable' - requires :body, type: String, desc: 'The content of a note' - optional :created_at, type: String, desc: 'The creation date of the note' + requires :noteable_id, type: Integer, desc: "The ID of the noteable" + requires :body, type: String, desc: "The content of a note" + optional :created_at, type: String, desc: "The creation date of the note" end post ":id/#{noteables_str}/:noteable_id/notes" do noteable = find_noteable(parent_type, noteables_str, params[:noteable_id]) @@ -77,7 +77,7 @@ module API note: params[:body], noteable_type: noteables_str.classify, noteable_id: noteable.id, - created_at: params[:created_at] + created_at: params[:created_at], } note = create_note(noteable, opts) @@ -93,9 +93,9 @@ module API success Entities::Note end params do - requires :noteable_id, type: Integer, desc: 'The ID of the noteable' - requires :note_id, type: Integer, desc: 'The ID of a note' - requires :body, type: String, desc: 'The content of a note' + requires :noteable_id, type: Integer, desc: "The ID of the noteable" + requires :note_id, type: Integer, desc: "The ID of a note" + requires :body, type: String, desc: "The content of a note" end put ":id/#{noteables_str}/:noteable_id/notes/:note_id" do noteable = find_noteable(parent_type, noteables_str, params[:noteable_id]) @@ -107,8 +107,8 @@ module API success Entities::Note end params do - requires :noteable_id, type: Integer, desc: 'The ID of the noteable' - requires :note_id, type: Integer, desc: 'The ID of a note' + requires :noteable_id, type: Integer, desc: "The ID of the noteable" + requires :note_id, type: Integer, desc: "The ID of a note" end delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do noteable = find_noteable(parent_type, noteables_str, params[:noteable_id]) |