diff options
author | Bogdan Gusiev <agresso@gmail.com> | 2012-01-07 11:11:04 +0200 |
---|---|---|
committer | Bogdan Gusiev <agresso@gmail.com> | 2012-01-07 11:11:04 +0200 |
commit | 30468f58a7bd36143daddc64ac23f86684c1de16 (patch) | |
tree | 26c55fda482217e196f1fff22d46a1f6a06f2afe /activerecord/test/models | |
parent | 686f94e7683db3f2e302a59d89293e46bb58b977 (diff) | |
download | rails-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.rb | 5 |
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) |