Skip to content
This repository
Browse code

Merge pull request #8405 from hsbt/fix-respond-initialize-dup

Handle respond_to? with private methods
  • Loading branch information...
commit 19599c274404169d5c75355a7b5a7f39795b4373 2 parents eaa0d0b + 127411f
Carlos Antonio da Silva carlosantoniodasilva authored
2  activemodel/lib/active_model/errors.rb
@@ -84,7 +84,7 @@ def initialize_dup(other)
84 84 end
85 85
86 86 # Backport dup from 1.9 so that #initialize_dup gets called
87   - unless Object.respond_to?(:initialize_dup)
  87 + unless Object.respond_to?(:initialize_dup, true)
88 88 def dup # :nodoc:
89 89 copy = super
90 90 copy.initialize_dup(self)
2  activemodel/lib/active_model/validations.rb
@@ -173,7 +173,7 @@ def initialize_dup(other) # :nodoc:
173 173 end
174 174
175 175 # Backport dup from 1.9 so that #initialize_dup gets called
176   - unless Object.respond_to?(:initialize_dup)
  176 + unless Object.respond_to?(:initialize_dup, true)
177 177 def dup # :nodoc:
178 178 copy = super
179 179 copy.initialize_dup(self)
2  activerecord/lib/active_record/base.rb
@@ -557,7 +557,7 @@ def initialize_dup(other)
557 557 end
558 558
559 559 # Backport dup from 1.9 so that initialize_dup() gets called
560   - unless Object.respond_to?(:initialize_dup)
  560 + unless Object.respond_to?(:initialize_dup, true)
561 561 def dup # :nodoc:
562 562 copy = super
563 563 copy.initialize_dup(self)

3 comments on commit 19599c2

fsword

Which version of rails3 could add this patch?I have used dup on my code

Guillermo Iguaran
Owner

This is in 3.2.13.rc1 and 4.0.0.beta1

fsword

ok. I‘m waiting for 3.2.13

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