Skip to content

Commit 5986ae3

Browse files
return follow object from unfollow method, apparently exclamation points are syntactically necessary
1 parent 3e9ec5b commit 5986ae3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/models/concerns/account/interactions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def unfollow!(other_account)
103103
follow = active_relationships.find_by(target_account: other_account)
104104
follow&.destroy
105105
try(:invalidate_mute_boosts_cache)
106+
107+
follow
106108
end
107109

108110
def unblock!(other_account)

spec/models/concerns/account/interactions_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@
757757

758758
it 'evicts the cache of boost muted accounts' do
759759
expect(me.excluded_boosts_from_timeline_account_ids).to be_empty
760-
me.follow(you, reblogs: false)
760+
me.follow!(you, reblogs: false)
761761
expect(me.excluded_boosts_from_timeline_account_ids).to include(you.id)
762-
me.follow(you, reblogs: true)
762+
me.follow!(you, reblogs: true)
763763
expect(me.excluded_boosts_from_timeline_account_ids).to be_empty
764764
end
765765
end

0 commit comments

Comments
 (0)