Skip to content
Browse files

ruby 2.0 makes protected methods return false for respond_to, so pass…

… true as the second param
  • Loading branch information...
1 parent f468d6e commit 00327721e4ddb1fc4c421b5eb89bd8f4d38a48fa @tenderlove tenderlove committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 activemodel/lib/active_model/attribute_methods.rb
View
2 activemodel/lib/active_model/attribute_methods.rb
@@ -287,7 +287,7 @@ def define_attribute_method(attr_name)
unless instance_method_already_implemented?(matcher.method_name(attr_name))
generate_method = "define_method_#{matcher.prefix}attribute#{matcher.suffix}"
- if respond_to?(generate_method)
+ if respond_to?(generate_method, true)
send(generate_method, attr_name)
else
method_name = matcher.method_name(attr_name)

0 comments on commit 0032772

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