Refactor `WebHookFlagSerializer`.
This commit is contained in:
parent
f0024f5ec7
commit
cba3942850
|
@ -8,7 +8,7 @@ class WebHookFlagSerializer < ApplicationSerializer
|
|||
:resolved_by
|
||||
|
||||
def post
|
||||
BasicPostSerializer.new(object.post, scope: scope, root: false).as_json
|
||||
WebHookPostSerializer.new(object.post, scope: scope, root: false).as_json
|
||||
end
|
||||
|
||||
def flag_type
|
||||
|
@ -32,10 +32,8 @@ class WebHookFlagSerializer < ApplicationSerializer
|
|||
end
|
||||
|
||||
def resolved_by
|
||||
if object.disposed_by_id.present?
|
||||
User.find(object.disposed_by_id).username
|
||||
end
|
||||
end
|
||||
|
||||
def include_resolved_by?
|
||||
object.disposed_by_id.present?
|
||||
|
|
Loading…
Reference in New Issue