aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-21 10:29:44 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-21 10:33:07 -0800
commit0052d90f207af6f1b8cf2f9dd455869fa9f01450 (patch)
treeb4ff7ac561395ff2ce5798110def56ad76c4916e /activemodel
parentcc848d625068013b86dd24f316c3f5d538379a70 (diff)
downloadrails-0052d90f207af6f1b8cf2f9dd455869fa9f01450.tar.gz
rails-0052d90f207af6f1b8cf2f9dd455869fa9f01450.tar.bz2
rails-0052d90f207af6f1b8cf2f9dd455869fa9f01450.zip
ruby 2.0 makes protected methods return false for respond_to, so pass true as the second param
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 91c6b9721c..f033a94c02 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -263,7 +263,7 @@ module ActiveModel
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