From 2db9f8a41c0e9d8978c0f6b80cb6efe5665168a7 Mon Sep 17 00:00:00 2001 From: Jared McFarland Date: Thu, 14 Apr 2011 09:00:34 +0800 Subject: added an exception to Object#in? to match the methods documentation --- activesupport/lib/active_support/core_ext/object/inclusion.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/activesupport/lib/active_support/core_ext/object/inclusion.rb b/activesupport/lib/active_support/core_ext/object/inclusion.rb index cc7edc0f17..f30333fd02 100644 --- a/activesupport/lib/active_support/core_ext/object/inclusion.rb +++ b/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 -- cgit v1.2.3