about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2018-01-22 22:24:22 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-01-22 14:24:22 +0100
commit17cecd75cadfd9914ffc233de01d41204ef7802c (patch)
tree3b8a6532283b18cddc92c48cede5a81246a26983 /app
parent8cc65cde274055a8c6e89a0de2d8811880d4b55d (diff)
Rename FetchRemoteResourceService to ResolveURLService (#6328)
The service used to be named FetchRemoteResourceService resolves local
URL as well.
Diffstat (limited to 'app')
-rw-r--r--app/services/resolve_url_service.rb (renamed from app/services/fetch_remote_resource_service.rb)2
-rw-r--r--app/services/search_service.rb14
2 files changed, 8 insertions, 8 deletions
diff --git a/app/services/fetch_remote_resource_service.rb b/app/services/resolve_url_service.rb
index 6d40796f2..1f2b24524 100644
--- a/app/services/fetch_remote_resource_service.rb
+++ b/app/services/resolve_url_service.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class FetchRemoteResourceService < BaseService
+class ResolveURLService < BaseService
   include JsonLdHelper
 
   attr_reader :url
diff --git a/app/services/search_service.rb b/app/services/search_service.rb
index 85ad94463..5f763b8f7 100644
--- a/app/services/search_service.rb
+++ b/app/services/search_service.rb
@@ -8,7 +8,7 @@ class SearchService < BaseService
 
     default_results.tap do |results|
       if url_query?
-        results.merge!(remote_resource_results) unless remote_resource.nil?
+        results.merge!(url_resource_results) unless url_resource.nil?
       elsif query.present?
         results[:accounts] = AccountSearchService.new.call(query, limit, account, resolve: resolve)
         results[:hashtags] = Tag.search_for(query.gsub(/\A#/, ''), limit) unless query.start_with?('@')
@@ -24,15 +24,15 @@ class SearchService < BaseService
     query =~ /\Ahttps?:\/\//
   end
 
-  def remote_resource_results
-    { remote_resource_symbol => [remote_resource] }
+  def url_resource_results
+    { url_resource_symbol => [url_resource] }
   end
 
-  def remote_resource
-    @_remote_resource ||= FetchRemoteResourceService.new.call(query)
+  def url_resource
+    @_url_resource ||= ResolveURLService.new.call(query)
   end
 
-  def remote_resource_symbol
-    remote_resource.class.name.downcase.pluralize.to_sym
+  def url_resource_symbol
+    url_resource.class.name.downcase.pluralize.to_sym
   end
 end