aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/topic.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/fixtures/topic.rb')
-rwxr-xr-xactiverecord/test/fixtures/topic.rb37
1 files changed, 0 insertions, 37 deletions
diff --git a/activerecord/test/fixtures/topic.rb b/activerecord/test/fixtures/topic.rb
deleted file mode 100755
index b2541c8640..0000000000
--- a/activerecord/test/fixtures/topic.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class Topic < ActiveRecord::Base
- has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
- serialize :content
-
- before_create :default_written_on
- before_destroy :destroy_children
-
- def parent
- Topic.find(parent_id)
- end
-
- # trivial method for testing Array#to_xml with :methods
- def topic_id
- id
- end
-
-
- protected
- def approved=(val)
- @custom_approved = val
- write_attribute(:approved, val)
- end
-
- def default_written_on
- self.written_on = Time.now unless attribute_present?("written_on")
- end
-
- def destroy_children
- self.class.delete_all "parent_id = #{id}"
- end
-
- def after_initialize
- if self.new_record?
- self.author_email_address = 'test@test.com'
- end
- end
-end \ No newline at end of file