From 7dbf6b87cccea7c2b5dbf1f4c5e07ae98706afb8 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Mon, 20 Jun 2011 18:32:08 +0400 Subject: [PATCH] Models delete dependencies --- app/models/album.rb | 2 +- app/models/artist.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/album.rb b/app/models/album.rb index 5633e5e..2f1fae9 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -1,4 +1,4 @@ class Album < ActiveRecord::Base belongs_to :artist - has_many :tracks, :order => 'bonus ASC, position ASC' + has_many :tracks, :order => 'bonus ASC, position ASC', :dependent => :destroy end diff --git a/app/models/artist.rb b/app/models/artist.rb index 2332d73..127f91c 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -1,3 +1,3 @@ class Artist < ActiveRecord::Base - has_many :albums, :order => 'year ASC, id ASC' + has_many :albums, :order => 'year ASC, id ASC', :dependent => :destroy end