Browse files

Revert "Ruby 1.9.2: explicitly raise NoMethodError for attempts at ex…

…plicit coercion"

This reverts commit 64082b3.

This change broke compatibility with 1.8.6 and was only needed for older 1.9.2 versions


  • Loading branch information...
1 parent 15cafbe commit b154b97ea47701dc39b9583fe8247b18990c5fda @NZKoz NZKoz committed Aug 10, 2010
@@ -230,10 +230,6 @@ def evaluate_attribute_method(attr_name, method_definition, method_name=attr_nam
# It's also possible to instantiate related objects, so a Client class belonging to the clients
# table with a +master_id+ foreign key can instantiate master through Client#master.
def method_missing(method_id, *args, &block)
- if method_id == :to_ary || method_id == :to_str
- raise NoMethodError, "undefined method `#{method_id}' for #{inspect}:#{self.class}"
- end
method_name = method_id.to_s
if self.class.private_method_defined?(method_name)
@@ -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
- raise NoMethodError, "undefined method `#{method}' for nil:NilClass"
+ super
elsif klass = METHOD_CLASS_MAP[method]
raise_nil_warning_for klass, method, caller

0 comments on commit b154b97

Please sign in to comment.