Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/acts_as_follower/followable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def method_missing(m, *args)
end

def respond_to?(m, include_private = false)
super || m.to_s[/count_(.+)_followers/] || m.to_s[/(.+)_followers/]
super || !!m.to_s[/count_(.+)_followers/] || !!m.to_s[/(.+)_followers/]
end

def blocked_followers_count
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_follower/follower.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def method_missing(m, *args)
end

def respond_to?(m, include_private = false)
super || m.to_s[/following_(.+)_count/] || m.to_s[/following_(.+)/]
super || !!m.to_s[/following_(.+)_count/] || !!m.to_s[/following_(.+)/]
end

# Returns a follow record for the current instance and followable object.
Expand Down
2 changes: 1 addition & 1 deletion lib/acts_as_follower/follower_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def apply_options_to_scope(scope, options = {})
end

def parent_classes
return DEFAULT_PARENTS unless ActsAsFollower.custom_parent_classes
return DEFAULT_PARENTS if ActsAsFollower.custom_parent_classes.blank?

ActiveSupport::Deprecation.warn("Setting custom parent classes is deprecated and will be removed in future versions.")
ActsAsFollower.custom_parent_classes + DEFAULT_PARENTS
Expand Down
2 changes: 1 addition & 1 deletion test/acts_as_followable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
end

should "return false when called with a nonexistent method" do
assert (not @oasis.respond_to?(:foobar))
assert (@oasis.respond_to?(:foobar) == false)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/acts_as_follower_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class ActsAsFollowerTest < ActiveSupport::TestCase
end

should "return false when called with a nonexistent method" do
assert (not @sam.respond_to?(:foobar))
assert (@sam.respond_to?(:foobar) == false)
end
end

Expand Down