aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJared McFarland <jared.online@gmail.com>2011-04-14 09:00:34 +0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-04-15 00:36:05 +0800
commit2db9f8a41c0e9d8978c0f6b80cb6efe5665168a7 (patch)
tree3501a73b658cadb676d94a70cdbb1ad14f22dd8e /activesupport/lib
parent89884c194af77f5324509db1d14e20f45fc106e0 (diff)
downloadrails-2db9f8a41c0e9d8978c0f6b80cb6efe5665168a7.tar.gz
rails-2db9f8a41c0e9d8978c0f6b80cb6efe5665168a7.tar.bz2
rails-2db9f8a41c0e9d8978c0f6b80cb6efe5665168a7.zip
added an exception to Object#in? to match the methods documentation
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/object/inclusion.rb1
1 files changed, 1 insertions, 0 deletions
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