about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaigo 3 Dango <zunda@users.noreply.github.com>2020-01-10 10:57:05 -1000
committerYamagishi Kazutoshi <ykzts@desire.sh>2020-01-11 05:57:05 +0900
commit206dfd7daddb888a8115804f2c88794b4230592a (patch)
tree0a32fe1edb7f600a42acd79e491301ec739bfd44
parent7583679ecfb7aab7de15e1c1df23d793c5447062 (diff)
Clarify keyword arguments with ** (#12769)
This change is to suppress the warning below on on ruby-2.7.0:

- warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
-rw-r--r--app/helpers/accounts_helper.rb2
-rw-r--r--app/lib/activitypub/activity.rb2
-rw-r--r--app/services/activitypub/process_collection_service.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb
index 53939adfc..e02bc2447 100644
--- a/app/helpers/accounts_helper.rb
+++ b/app/helpers/accounts_helper.rb
@@ -3,7 +3,7 @@
 module AccountsHelper
   def display_name(account, **options)
     if options[:custom_emojify]
-      Formatter.instance.format_display_name(account, options)
+      Formatter.instance.format_display_name(account, **options)
     else
       account.display_name.presence || account.username
     end
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb
index 49b1dc9cd..ee35e1e8d 100644
--- a/app/lib/activitypub/activity.rb
+++ b/app/lib/activitypub/activity.rb
@@ -21,7 +21,7 @@ class ActivityPub::Activity
   class << self
     def factory(json, account, **options)
       @json = json
-      klass&.new(json, account, options)
+      klass&.new(json, account, **options)
     end
 
     private
diff --git a/app/services/activitypub/process_collection_service.rb b/app/services/activitypub/process_collection_service.rb
index a2a2e7071..e6ccaccc9 100644
--- a/app/services/activitypub/process_collection_service.rb
+++ b/app/services/activitypub/process_collection_service.rb
@@ -37,7 +37,7 @@ class ActivityPub::ProcessCollectionService < BaseService
   end
 
   def process_item(item)
-    activity = ActivityPub::Activity.factory(item, @account, @options)
+    activity = ActivityPub::Activity.factory(item, @account, **@options)
     activity&.perform
   end