Skip to content
Browse files

Ruby 1.9.2: explicitly raise NoMethodError for explicit coercion atte…

…mpts. Calling super gives us NameErrors.
  • Loading branch information...
1 parent adc2115 commit 071af66e9ede4057bf1d3e3d248b3949d74bc9c5 @jeremy jeremy committed Dec 6, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/whiny_nil.rb
View
2 activesupport/lib/active_support/whiny_nil.rb
@@ -45,7 +45,7 @@ def id
def method_missing(method, *args, &block)
# Ruby 1.9.2: disallow explicit coercion via method_missing.
if method == :to_ary || method == :to_str
- super
+ raise NoMethodError, "undefined method `#{method}' for nil:NilClass"
elsif klass = METHOD_CLASS_MAP[method]
raise_nil_warning_for klass, method, caller
else

0 comments on commit 071af66

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