Allow ActivityPub Note's tag and attachment to be single objects (#5534)
This commit is contained in:
parent
0129f5eada
commit
0cb329f63a
2 changed files with 8 additions and 4 deletions
|
@ -9,6 +9,10 @@ module JsonLdHelper
|
|||
value.is_a?(Array) ? value.first : value
|
||||
end
|
||||
|
||||
def as_array(value)
|
||||
value.is_a?(Array) ? value : [value]
|
||||
end
|
||||
|
||||
def value_or_id(value)
|
||||
value.is_a?(String) || value.nil? ? value : value['id']
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue