Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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

Conflicts:

	activerecord/lib/active_record/attribute_methods.rb
  • Loading branch information...
commit b154b97ea47701dc39b9583fe8247b18990c5fda 1 parent 15cafbe
Michael Koziarski NZKoz authored
4 activerecord/lib/active_record/attribute_methods.rb
View
@@ -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)
2  activesupport/lib/active_support/whiny_nil.rb
View
@@ -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
else
Please sign in to comment.
Something went wrong with that request. Please try again.