aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-07-01 20:36:53 -0300
committerEmilio Tagua <miloops@gmail.com>2009-07-01 20:36:53 -0300
commit084e4a2dd4322c9ea748a426cb37bf90ab83613d (patch)
tree90c6130b3f8becfd733618752a0649e932f5d514 /activerecord/lib
parent260c847817bbc3ad990609b7e41f787e1d2940ea (diff)
parent92bff2ebf122252cf3ff64160bdfa9891fcff3f4 (diff)
downloadrails-084e4a2dd4322c9ea748a426cb37bf90ab83613d.tar.gz
rails-084e4a2dd4322c9ea748a426cb37bf90ab83613d.tar.bz2
rails-084e4a2dd4322c9ea748a426cb37bf90ab83613d.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 1f96e6dcc5..bb6869c6ce 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2864,6 +2864,13 @@ module ActiveRecord #:nodoc:
@attributes.frozen?
end
+ # Returns duplicated record with unfreezed attributes.
+ def dup
+ obj = super
+ obj.instance_variable_set('@attributes', instance_variable_get('@attributes').dup)
+ obj
+ end
+
# Returns +true+ if the record is read only. Records loaded through joins with piggy-back
# attributes will be marked as read only since they cannot be saved.
def readonly?