aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2012-01-07 11:11:04 +0200
committerBogdan Gusiev <agresso@gmail.com>2012-01-07 11:11:04 +0200
commit30468f58a7bd36143daddc64ac23f86684c1de16 (patch)
tree26c55fda482217e196f1fff22d46a1f6a06f2afe /activerecord/test/models
parent686f94e7683db3f2e302a59d89293e46bb58b977 (diff)
downloadrails-30468f58a7bd36143daddc64ac23f86684c1de16.tar.gz
rails-30468f58a7bd36143daddc64ac23f86684c1de16.tar.bz2
rails-30468f58a7bd36143daddc64ac23f86684c1de16.zip
Fixed after_initialize callbacks call on AR model #dup
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/topic.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 1a1a18166a..8bcb9df8a8 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -80,6 +80,11 @@ class Topic < ActiveRecord::Base
after_initialize :set_email_address
+ class_attribute :after_initialize_called
+ after_initialize do
+ self.class.after_initialize_called = true
+ end
+
def approved=(val)
@custom_approved = val
write_attribute(:approved, val)