Do not render note in RelationshipSerializer (#193)

RelationshipSerializer is used to render an Account's
block/mute/follow/etc. relationships; there won't be a note present on
an Account.  We'll need to look at a different serializer to render
notes.
This commit is contained in:
David Yip 2018-01-26 10:13:17 -06:00
parent 041168df31
commit 8f476ee39e
No known key found for this signature in database
GPG Key ID: 7DA0036508FCC0CC
1 changed files with 1 additions and 6 deletions

View File

@ -2,17 +2,12 @@
class REST::RelationshipSerializer < ActiveModel::Serializer
attributes :id, :following, :showing_reblogs, :followed_by, :blocking,
:muting, :muting_notifications, :requested, :domain_blocking,
:note
:muting, :muting_notifications, :requested, :domain_blocking
def id
object.id.to_s
end
def note
object.respond_to?(:note) ? object.note&.text : nil
end
def following
instance_options[:relationships].following[object.id] ? true : false
end