Support Actors/Statuses with multiple types (#7305)
* Add equals_or_includes_any? helper in JsonLdHelper * Support arrays in JSON-LD type fields for actors/tags/objects. * Spec for resolving accounts with extension types * Style tweaks for codeclimate
This commit is contained in:
parent
86efccce2a
commit
dc786c0cf4
12 changed files with 43 additions and 24 deletions
|
@ -5,6 +5,10 @@ module JsonLdHelper
|
|||
haystack.is_a?(Array) ? haystack.include?(needle) : haystack == needle
|
||||
end
|
||||
|
||||
def equals_or_includes_any?(haystack, needles)
|
||||
needles.any? { |needle| equals_or_includes?(haystack, needle) }
|
||||
end
|
||||
|
||||
def first_of_value(value)
|
||||
value.is_a?(Array) ? value.first : value
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue