From 3122d321fd5d05d549274487e5a52f3a73bc6f43 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Mon, 8 Oct 2007 06:21:38 +0000 Subject: Make sure AR::Base#clone handles attr changes made in after_initialize hooks. Closes #7191 [weyus] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/fixtures/topic.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activerecord/test/fixtures/topic.rb') diff --git a/activerecord/test/fixtures/topic.rb b/activerecord/test/fixtures/topic.rb index dd71d6bf2b..b2541c8640 100755 --- a/activerecord/test/fixtures/topic.rb +++ b/activerecord/test/fixtures/topic.rb @@ -28,4 +28,10 @@ class Topic < ActiveRecord::Base def destroy_children self.class.delete_all "parent_id = #{id}" end -end + + def after_initialize + if self.new_record? + self.author_email_address = 'test@test.com' + end + end +end \ No newline at end of file -- cgit v1.2.3