about summary refs log tree commit diff
path: root/app/services/unfollow_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/unfollow_service.rb')
-rw-r--r--app/services/unfollow_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/unfollow_service.rb b/app/services/unfollow_service.rb
index 151f3674f..c3e70d414 100644
--- a/app/services/unfollow_service.rb
+++ b/app/services/unfollow_service.rb
@@ -13,13 +13,15 @@ class UnfollowService < BaseService
     @target_account = target_account
     @options        = options
 
-    unfollow! || undo_follow_request!
+    unfollow!
+    undo_follow_request!
   end
 
   private
 
   def unfollow!
     follow = Follow.find_by(account: @source_account, target_account: @target_account)
+    follow = Follow.create!(account: @source_account, target_account: @target_account) if follow.blank? && @options[:force]
 
     return unless follow
 
@@ -34,6 +36,7 @@ class UnfollowService < BaseService
 
   def undo_follow_request!
     follow_request = FollowRequest.find_by(account: @source_account, target_account: @target_account)
+    follow_request = FollowRequest.create!(account: @source_account, target_account: @target_account) if follow_request.blank? && @options[:force]
 
     return unless follow_request