diff --git a/lib/acts_as_follower/followable.rb b/lib/acts_as_follower/followable.rb index dda4c52..5f023ff 100644 --- a/lib/acts_as_follower/followable.rb +++ b/lib/acts_as_follower/followable.rb @@ -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 diff --git a/lib/acts_as_follower/follower.rb b/lib/acts_as_follower/follower.rb index 8fa3300..93309ed 100644 --- a/lib/acts_as_follower/follower.rb +++ b/lib/acts_as_follower/follower.rb @@ -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. diff --git a/lib/acts_as_follower/follower_lib.rb b/lib/acts_as_follower/follower_lib.rb index fa40023..1d4a786 100644 --- a/lib/acts_as_follower/follower_lib.rb +++ b/lib/acts_as_follower/follower_lib.rb @@ -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 diff --git a/test/acts_as_followable_test.rb b/test/acts_as_followable_test.rb index 5f95412..8f675a0 100644 --- a/test/acts_as_followable_test.rb +++ b/test/acts_as_followable_test.rb @@ -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 diff --git a/test/acts_as_follower_test.rb b/test/acts_as_follower_test.rb index 0aece81..69289eb 100644 --- a/test/acts_as_follower_test.rb +++ b/test/acts_as_follower_test.rb @@ -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