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:16 -0800
commit5d0c1814ad624090620e907012e0eaf353468202 (patch)
treeae097ea7f81922ca8833d760ed70b60117183ae6 /activemodel
parenta29554461e43f8c1b428422f49103aa80275bf46 (diff)
downloadrails-5d0c1814ad624090620e907012e0eaf353468202.tar.gz
rails-5d0c1814ad624090620e907012e0eaf353468202.tar.bz2
rails-5d0c1814ad624090620e907012e0eaf353468202.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 52f270ff33..97a83e58af 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -223,7 +223,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