From b97e0a1127d45e25e4281d6c1b5fb9a57f0efea6 Mon Sep 17 00:00:00 2001 From: Angelo capilleri Date: Fri, 8 Jun 2012 19:39:17 +0200 Subject: Fix the the backport of the object dup with the ruby 1.9.3p194. At the end of initialize_dup was added the call to super if it exists, so it also works with 1.8.7 where initialize_dup doesn't exist. This issu was introduced with the pull request #6324 --- activemodel/lib/active_model/validations.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 18cd53e130..f38121c175 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -168,8 +168,9 @@ module ActiveModel # Clean the +Errors+ object if instance is duped def initialize_dup(other) # :nodoc: @errors = nil + super if defined?(super) end - + # Backport dup from 1.9 so that #initialize_dup gets called unless Object.respond_to?(:initialize_dup) def dup # :nodoc: -- cgit v1.2.3