about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2018-05-02 05:40:24 -0500
committerEugen Rochko <eugen@zeonfederated.com>2018-05-02 12:40:24 +0200
commitdc786c0cf4467ade8db7d8b17e09f16923bfc1e8 (patch)
tree955931c945e9137b4883571cfd2d23bec1d59397 /app/helpers
parent86efccce2a874d16aa783d989ff4824bcfac40b5 (diff)
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
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/jsonld_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/jsonld_helper.rb b/app/helpers/jsonld_helper.rb
index dfb8fcb8b..a3cfdadb8 100644
--- a/app/helpers/jsonld_helper.rb
+++ b/app/helpers/jsonld_helper.rb
@@ -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