has many destroy child rails code example
Example: should destroy child reviews when destroying self active record
class Parent < ActiveRecord::Base
has_many :children, dependent: :destroy
end
class Parent < ActiveRecord::Base
has_many :children, dependent: :destroy
end