mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Ruby 1.9.2: explicitly raise NoMethodError for explicit coercion attempts. Calling super gives us NameErrors.
This commit is contained in:
parent
adc2115132
commit
071af66e9e
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue