about summary refs log tree commit diff
path: root/app/helpers/jsonld_helper.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-03-12 09:11:36 +0100
committerGitHub <noreply@github.com>2022-03-12 09:11:36 +0100
commitddbe906c25fc370c92fa557d3637d50b7af97754 (patch)
tree390d410ca8f07ac883eb3395118864619e054653 /app/helpers/jsonld_helper.rb
parent883099f3c953ee5acb30b308f7f5d985e3126f02 (diff)
Fix not updating a status when newer version is fetched manually (#17745)
Diffstat (limited to 'app/helpers/jsonld_helper.rb')
-rw-r--r--app/helpers/jsonld_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/jsonld_helper.rb b/app/helpers/jsonld_helper.rb
index ef16eef08..102e4b132 100644
--- a/app/helpers/jsonld_helper.rb
+++ b/app/helpers/jsonld_helper.rb
@@ -15,6 +15,14 @@ module JsonLdHelper
     value.is_a?(Array) ? value.first : value
   end
 
+  def uri_from_bearcap(str)
+    if str&.start_with?('bear:')
+      Addressable::URI.parse(str).query_values['u']
+    else
+      str
+    end
+  end
+
   # The url attribute can be a string, an array of strings, or an array of objects.
   # The objects could include a mimeType. Not-included mimeType means it's text/html.
   def url_to_href(value, preferred_type = nil)