From 7dfa2a47ee35e399399fa905d15087680b6b3cd7 Mon Sep 17 00:00:00 2001 From: Charles Broskoski Date: Thu, 7 Apr 2022 11:49:48 -0400 Subject: [PATCH] Fix logic for restricted_by? --- lib/acts_as_follower/followable.rb | 2 +- lib/acts_as_follower/version.rb | 2 +- test/acts_as_followable_test.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/acts_as_follower/followable.rb b/lib/acts_as_follower/followable.rb index 5bbfd19..324c78e 100644 --- a/lib/acts_as_follower/followable.rb +++ b/lib/acts_as_follower/followable.rb @@ -93,7 +93,7 @@ def followed_by?(follower) # Returns true if the current instance is blocked by the passed record # Returns false if the current instance is not blocked by the passed record or no follow is found def restricted_by?(follower) - followings.blocked.for_follower(follower).first.present? + follows.blocked.for_followable(follower).first.present? end def block(follower) diff --git a/lib/acts_as_follower/version.rb b/lib/acts_as_follower/version.rb index ad3b945..52e465c 100644 --- a/lib/acts_as_follower/version.rb +++ b/lib/acts_as_follower/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActsAsFollower - VERSION = '0.2.2' + VERSION = '0.2.3' end diff --git a/test/acts_as_followable_test.rb b/test/acts_as_followable_test.rb index 93c55b0..45f9588 100644 --- a/test/acts_as_followable_test.rb +++ b/test/acts_as_followable_test.rb @@ -85,8 +85,8 @@ class ActsAsFollowableTest < ActiveSupport::TestCase end should 'return_restricted_status' do - assert_equal true, @jon.restricted_by?(@sam) - assert_equal false, @sam.restricted_by?(@jon) + assert_equal false, @jon.restricted_by?(@sam) + assert_equal true, @sam.restricted_by?(@jon) end end