about summary refs log tree commit diff
path: root/app/models/follow_request.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-11 17:09:36 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-11 17:13:11 +0100
commit50660d54e8cabd08fee649a6abc26f35a8d7a82c (patch)
tree0124bd26554896a409dc7b7b6bb357fc8be8e2c6 /app/models/follow_request.rb
parent0b95eb36128077b3074f661dd451a90a18441ef0 (diff)
Fix semantics of follow requests another slaps
Diffstat (limited to 'app/models/follow_request.rb')
-rw-r--r--app/models/follow_request.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/models/follow_request.rb b/app/models/follow_request.rb
index 989c2c2a2..080c686e5 100644
--- a/app/models/follow_request.rb
+++ b/app/models/follow_request.rb
@@ -13,7 +13,8 @@ class FollowRequest < ApplicationRecord
   validates :account_id, uniqueness: { scope: :target_account_id }
 
   def authorize!
-    @verb = :authorize
+    @verb   = :authorize
+    @target = clone.freeze
 
     account.follow!(target_account)
     MergeWorker.perform_async(target_account.id, account.id)
@@ -22,7 +23,9 @@ class FollowRequest < ApplicationRecord
   end
 
   def reject!
-    @verb = :reject
+    @verb   = :reject
+    @target = clone.freeze
+
     destroy!
   end
 
@@ -31,11 +34,11 @@ class FollowRequest < ApplicationRecord
   end
 
   def target
-    target_account
-  end
-
-  def object_type
-    :person
+    if destroyed? && @verb
+      @target
+    else
+      target_account
+    end
   end
 
   def hidden?