Model dependecies
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
class Artist < ActiveRecord::Base
|
||||
has_many :albums, :order => 'has_pic DESC, year ASC, id ASC', :dependent => :destroy
|
||||
has_many :artist_links, :dependent => :destroy
|
||||
has_many :artist_aliases, :dependent => :destroy
|
||||
has_many :tracks, :through => :track_artists
|
||||
end
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
class ArtistAlias < ActiveRecord::Base
|
||||
belongs_to :artist
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
class Track < ActiveRecord::Base
|
||||
belongs_to :album
|
||||
belongs_to :artist, :through => :track_artists
|
||||
end
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class TrackArtist < ActiveRecord::Base
|
||||
belongs_to :track
|
||||
belongs_to :artist
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user