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