diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 18:12:57 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 18:12:57 +0000 |
commit | 5c50df27cf1a81cd8ace5cad83bc7acee61311da (patch) | |
tree | e56ba71ebd564f0e5147f819ca6ded4d46e1a885 /activerecord/test/fixtures | |
parent | e1ee02207c75c5b8e5227f64d02c47faa57c8424 (diff) | |
download | rails-5c50df27cf1a81cd8ace5cad83bc7acee61311da.tar.gz rails-5c50df27cf1a81cd8ace5cad83bc7acee61311da.tar.bz2 rails-5c50df27cf1a81cd8ace5cad83bc7acee61311da.zip |
Attempted to capture #286 in a unit test, but couldnt get it to fail
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rwxr-xr-x | activerecord/test/fixtures/reply.rb | 4 | ||||
-rwxr-xr-x | activerecord/test/fixtures/topic.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/reply.rb b/activerecord/test/fixtures/reply.rb index 127f2052f3..d0ec895127 100755 --- a/activerecord/test/fixtures/reply.rb +++ b/activerecord/test/fixtures/reply.rb @@ -1,5 +1,6 @@ class Reply < Topic belongs_to :topic, :foreign_key => "parent_id", :counter_cache => true + has_many :silly_replies, :dependent => true, :foreign_key => "parent_id" validate :errors_on_empty_content validate_on_create :title_is_wrong_create @@ -27,4 +28,7 @@ class Reply < Topic def validate_on_update errors.add("title", "is Wrong Update") if attribute_present?("title") && title == "Wrong Update" end +end + +class SillyReply < Reply end
\ No newline at end of file diff --git a/activerecord/test/fixtures/topic.rb b/activerecord/test/fixtures/topic.rb index 55c94e9e88..60022aa46b 100755 --- a/activerecord/test/fixtures/topic.rb +++ b/activerecord/test/fixtures/topic.rb @@ -1,5 +1,5 @@ class Topic < ActiveRecord::Base - has_many :replies, :foreign_key => "parent_id" + has_many :replies, :dependent => true, :foreign_key => "parent_id" serialize :content before_create :default_written_on |