Permalink
Browse files

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

Handle respond_to? with private methods
  • Loading branch information...
2 parents eaa0d0b + 127411f commit 19599c274404169d5c75355a7b5a7f39795b4373 @carlosantoniodasilva carlosantoniodasilva committed Dec 3, 2012
View
2 activemodel/lib/active_model/errors.rb
@@ -84,7 +84,7 @@ def initialize_dup(other)
end
# Backport dup from 1.9 so that #initialize_dup gets called
- unless Object.respond_to?(:initialize_dup)
+ unless Object.respond_to?(:initialize_dup, true)
def dup # :nodoc:
copy = super
copy.initialize_dup(self)
View
2 activemodel/lib/active_model/validations.rb
@@ -173,7 +173,7 @@ def initialize_dup(other) # :nodoc:
end
# Backport dup from 1.9 so that #initialize_dup gets called
- unless Object.respond_to?(:initialize_dup)
+ unless Object.respond_to?(:initialize_dup, true)
def dup # :nodoc:
copy = super
copy.initialize_dup(self)
View
2 activerecord/lib/active_record/base.rb
@@ -557,7 +557,7 @@ def initialize_dup(other)
end
# Backport dup from 1.9 so that initialize_dup() gets called
- unless Object.respond_to?(:initialize_dup)
+ unless Object.respond_to?(:initialize_dup, true)
def dup # :nodoc:
copy = super
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

@guilleiguaran
Ruby on Rails member

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.