Permalink
Browse files

Specify :dependent => :nullify on Category so that when a category is…

… deleted the forums beneath it have category_id set to nil. Closes #25.
  • Loading branch information...
Ryan Bigg
Ryan Bigg committed Mar 14, 2010
1 parent c6de2d1 commit 206c81b48f70a97b5c6da0e5732926c2c4a96494
Showing with 3 additions and 1 deletion.
  1. +1 −1 app/models/category.rb
  2. +1 −0 spec/support/blueprints/post.rb
  3. +1 −0 spec/support/blueprints/topics.rb
View
@@ -3,7 +3,7 @@ class Category < ActiveRecord::Base
acts_as_tree
acts_as_list
- has_many :forums
+ has_many :forums, :dependent => :nullify
has_many :permissions
has_many :groups, :through => :permissions
@@ -1,3 +1,4 @@
Post.blueprint do
text { "This is some default text" }
+ ip { Ip.make(:localhost) }
end
@@ -1,4 +1,5 @@
Topic.blueprint do
subject "Default topic"
user { User.ensure(:administrator) }
+ ip { Ip.make(:localhost) }
end

0 comments on commit 206c81b

Please sign in to comment.