]> cat aescling's git repositories - mastodon.git/commitdiff
Fix code referencing wrong class (#12263)
authorThibG <thib@sitedethib.com>
Mon, 4 Nov 2019 12:02:27 +0000 (13:02 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 4 Nov 2019 12:02:27 +0000 (13:02 +0100)
For some reason, I have seen this only triggered here:
https://circleci.com/gh/tootsuite/mastodon/98324?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link

But Follow.find_by referenced the ActivityPub::Activity::Follow class
instead of the model class.

app/lib/activitypub/activity.rb

index 5cd48a6aec8bc6a068a07e51e1184dbff3d20c31..cdd40604376cf9155bd7c8bd56014ecef100056d 100644 (file)
@@ -158,7 +158,7 @@ class ActivityPub::Activity
   end
 
   def follow_from_object
-    @follow ||= Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil?
+    @follow ||= ::Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil?
   end
 
   def fetch_remote_original_status