Skip to content

Commit

Permalink
ruby 2.0 makes protected methods return false for respond_to, so pass…
Browse files Browse the repository at this point in the history
… true as the second param
  • Loading branch information
tenderlove committed Feb 21, 2012
1 parent f468d6e commit 0032772
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/attribute_methods.rb
Expand Up @@ -287,7 +287,7 @@ def define_attribute_method(attr_name)
unless instance_method_already_implemented?(matcher.method_name(attr_name)) unless instance_method_already_implemented?(matcher.method_name(attr_name))
generate_method = "define_method_#{matcher.prefix}attribute#{matcher.suffix}" 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) send(generate_method, attr_name)
else else
method_name = matcher.method_name(attr_name) method_name = matcher.method_name(attr_name)
Expand Down

0 comments on commit 0032772

Please sign in to comment.