Models delete dependencies
This commit is contained in:
parent
e6b8ebfde0
commit
7dbf6b87cc
|
@ -1,4 +1,4 @@
|
||||||
class Album < ActiveRecord::Base
|
class Album < ActiveRecord::Base
|
||||||
belongs_to :artist
|
belongs_to :artist
|
||||||
has_many :tracks, :order => 'bonus ASC, position ASC'
|
has_many :tracks, :order => 'bonus ASC, position ASC', :dependent => :destroy
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
class Artist < ActiveRecord::Base
|
class Artist < ActiveRecord::Base
|
||||||
has_many :albums, :order => 'year ASC, id ASC'
|
has_many :albums, :order => 'year ASC, id ASC', :dependent => :destroy
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue