Skip to content
Browse files

added an exception to Object#in? to match the methods documentation

  • Loading branch information...
1 parent 443af58 commit 8f06e154b1ef9beb9007ab3b01b3d08b9cff3074 @jaredonline jaredonline committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 activesupport/lib/active_support/core_ext/object/inclusion.rb
View
1 activesupport/lib/active_support/core_ext/object/inclusion.rb
@@ -6,6 +6,7 @@ class Object
# "Konata".in?(characters) # => true
#
def in?(another_object)
+ raise ArgumentError.new("You must supply another object that responds to include?") unless another_object.respond_to?(:include?)
another_object.include?(self)
end
end

0 comments on commit 8f06e15

Please sign in to comment.
Something went wrong with that request. Please try again.