diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-12-06 18:03:18 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-12-06 18:03:18 -0800 |
commit | 071af66e9ede4057bf1d3e3d248b3949d74bc9c5 (patch) | |
tree | 8fffdd4a8bd0fe29d215129f61f749e89931a0ae /activesupport/lib | |
parent | adc2115132f22cbb772716c167f75346ab6d6c36 (diff) | |
download | rails-071af66e9ede4057bf1d3e3d248b3949d74bc9c5.tar.gz rails-071af66e9ede4057bf1d3e3d248b3949d74bc9c5.tar.bz2 rails-071af66e9ede4057bf1d3e3d248b3949d74bc9c5.zip |
Ruby 1.9.2: explicitly raise NoMethodError for explicit coercion attempts. Calling super gives us NameErrors.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/whiny_nil.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/whiny_nil.rb b/activesupport/lib/active_support/whiny_nil.rb index c4aaba7ab3..c3ed659d6b 100644 --- a/activesupport/lib/active_support/whiny_nil.rb +++ b/activesupport/lib/active_support/whiny_nil.rb @@ -45,7 +45,7 @@ class NilClass 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 |