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 cc848d6 commit 0052d90f207af6f1b8cf2f9dd455869fa9f01450 @tenderlove tenderlove committed Feb 21, 2012
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
@@ -263,7 +263,7 @@ def define_attribute_method(attr_name)
unless instance_method_already_implemented?(method_name)
generate_method = "define_method_#{matcher.method_missing_target}"
- if respond_to?(generate_method)
+ if respond_to?(generate_method, true)
send(generate_method, attr_name)
else
define_optimized_call generated_attribute_methods, method_name, matcher.method_missing_target, attr_name.to_s

0 comments on commit 0052d90

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