Skip to content

Commit

Permalink
Fix logic for restricted_by?
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoski committed Apr 7, 2022
1 parent 0f74e1d commit 7dfa2a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/acts_as_follower/followable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_follower/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ActsAsFollower
VERSION = '0.2.2'
VERSION = '0.2.3'
end
4 changes: 2 additions & 2 deletions test/acts_as_followable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7dfa2a4

Please sign in to comment.