From 2831996483c6a045f1f38d8030256eb58d9771c3 Mon Sep 17 00:00:00 2001 From: Eric Chapweske Date: Sun, 18 Oct 2009 10:22:22 -0500 Subject: Fixed: #without_typecast should only disable typecasting on the duplicated attributes [#3387 state:resolved] Signed-off-by: Joshua Peek --- activerecord/lib/active_record/attributes/typecasting.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attributes/typecasting.rb b/activerecord/lib/active_record/attributes/typecasting.rb index de36a297eb..56c32f9895 100644 --- a/activerecord/lib/active_record/attributes/typecasting.rb +++ b/activerecord/lib/active_record/attributes/typecasting.rb @@ -37,6 +37,12 @@ module ActiveRecord hash.merge!(self) hash end + + def dup # :nodoc: + copy = super + copy.types = types.dup + copy + end # Provides a duplicate with typecasting disabled. # -- cgit v1.2.3