Models delete dependencies

This commit is contained in:
magnolia-fan
2011-06-20 18:32:08 +04:00
parent e6b8ebfde0
commit 7dbf6b87cc
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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