diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-08-17 20:27:11 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-08-17 20:27:11 +0300 |
commit | 7c491d4fefbd0a079a497e5cae07056bfe467622 (patch) | |
tree | 5e41c07992069943d6b4eff30b9f6a70b82f317a /app/serializers | |
parent | 5f758aff57dc54df7d92d0fb63e706d58cf1093d (diff) |
Misc tweaks
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/note_entity.rb | 4 | ||||
-rw-r--r-- | app/serializers/note_user_entity.rb | 3 | ||||
-rw-r--r-- | app/serializers/user_note_entity.rb | 9 |
3 files changed, 5 insertions, 11 deletions
diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb index 416730470dc..663a9c06c40 100644 --- a/app/serializers/note_entity.rb +++ b/app/serializers/note_entity.rb @@ -3,7 +3,7 @@ class NoteEntity < API::Entities::Note expose :type - expose :author, using: UserNoteEntity + expose :author, using: NoteUserEntity expose :human_access do |note| note.project.team.human_max_access(note.author_id) @@ -15,7 +15,7 @@ class NoteEntity < API::Entities::Note expose :redacted_note_html, as: :note_html expose :last_edited_at, if: -> (note, _) { note.is_edited? } - expose :last_edited_by, using: UserNoteEntity, if: -> (note, _) { note.is_edited? } + expose :last_edited_by, using: NoteUserEntity, if: -> (note, _) { note.is_edited? } expose :current_user do expose :can_edit do |note| diff --git a/app/serializers/note_user_entity.rb b/app/serializers/note_user_entity.rb new file mode 100644 index 00000000000..7289f3a0222 --- /dev/null +++ b/app/serializers/note_user_entity.rb @@ -0,0 +1,3 @@ +class NoteUserEntity < UserEntity + unexpose :web_url +end diff --git a/app/serializers/user_note_entity.rb b/app/serializers/user_note_entity.rb deleted file mode 100644 index fbd87470380..00000000000 --- a/app/serializers/user_note_entity.rb +++ /dev/null @@ -1,9 +0,0 @@ -class UserNoteEntity < API::Entities::UserBasic - include RequestAwareEntity - - unexpose :web_url - - expose :path do |user| - user_path(user) - end -end |