about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-12-06 19:41:57 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-12-06 11:41:57 +0100
commitb21db9bbde3784556a5861e2cdec0c8c2184c72e (patch)
tree5702878677aa85352185fd22e69fb10cd142d9ee /app/models
parent42bcbd36b72c7ddc5ae1ecced09614863ca382bd (diff)
Using double splat operator (#5859)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/remote_follow.rb4
-rw-r--r--app/models/session_activation.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/remote_follow.rb b/app/models/remote_follow.rb
index c3f867743..070144e2d 100644
--- a/app/models/remote_follow.rb
+++ b/app/models/remote_follow.rb
@@ -7,8 +7,8 @@ class RemoteFollow
 
   validates :acct, presence: true
 
-  def initialize(attrs = {})
-    @acct = attrs[:acct].gsub(/\A@/, '').strip unless attrs[:acct].nil?
+  def initialize(attrs = nil)
+    @acct = attrs[:acct].gsub(/\A@/, '').strip if !attrs.nil? && !attrs[:acct].nil?
   end
 
   def valid?
diff --git a/app/models/session_activation.rb b/app/models/session_activation.rb
index d19489b36..8b711d0d6 100644
--- a/app/models/session_activation.rb
+++ b/app/models/session_activation.rb
@@ -53,7 +53,7 @@ class SessionActivation < ApplicationRecord
       id && where(session_id: id).exists?
     end
 
-    def activate(options = {})
+    def activate(**options)
       activation = create!(options)
       purge_old
       activation