Written by Sean Behan on Sun Jun 17th 2012

In the parent class place the following code

has_many :posts, :dependent => :destroy

This used to be accomplished with

has_many :posts, :dependent=>true

Check out the Rails docs for more information http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html


Tagged with..
#dependent #has_many #rails 2.3 #Ruby on Rails

Just finishing up brewing up some fresh ground comments...