diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-26 19:39:40 -0500 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-07-21 22:35:25 +0300 |
commit | cf926f6b7f412c194a47329f101dee1adc6d19dc (patch) | |
tree | edfd3c83e6fe14e2344cfb2b60e31a331e2a9ef3 /app/serializers/note_entity.rb | |
parent | ebf915511359c336b99c1127c5b902f8757ba5e0 (diff) | |
download | gitlab-ce-cf926f6b7f412c194a47329f101dee1adc6d19dc.tar.gz |
Remove duplicate attributes from discussion entity and move note.can_edit into note.current_user
Diffstat (limited to 'app/serializers/note_entity.rb')
-rw-r--r-- | app/serializers/note_entity.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb index 7a49ec4ef55..53b3ed41940 100644 --- a/app/serializers/note_entity.rb +++ b/app/serializers/note_entity.rb @@ -17,8 +17,10 @@ class NoteEntity < API::Entities::Note expose :last_edited_at, if: -> (note, _) { note.is_edited? } expose :last_edited_by, using: UserEntity, if: -> (note, _) { note.is_edited? } - expose :can_edit do |note| - Ability.can_edit_note?(request.current_user, note) + expose :current_user do + expose :can_edit do |note| + Ability.can_edit_note?(request.current_user, note) + end end expose :system_note_icon_name, if: -> (note, _) { note.system? } do |note| |