Models delete dependencies
This commit is contained in:
+1
-1
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user