diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-10-08 06:21:38 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-10-08 06:21:38 +0000 |
commit | 3122d321fd5d05d549274487e5a52f3a73bc6f43 (patch) | |
tree | 11d92375dd5ac760b3ef75148836794f30ab2592 /activerecord/test/fixtures/topic.rb | |
parent | 4eaa8ba5bec9001e97349e7dfd565c7215085834 (diff) | |
download | rails-3122d321fd5d05d549274487e5a52f3a73bc6f43.tar.gz rails-3122d321fd5d05d549274487e5a52f3a73bc6f43.tar.bz2 rails-3122d321fd5d05d549274487e5a52f3a73bc6f43.zip |
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
Diffstat (limited to 'activerecord/test/fixtures/topic.rb')
-rwxr-xr-x | activerecord/test/fixtures/topic.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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 |