This commit is contained in:
Gregory Eremin
2011-09-22 14:37:53 +04:00
parent dbdff13cd0
commit 3ea944fbb0
23 changed files with 206 additions and 6 deletions
+1
View File
@@ -1,4 +1,5 @@
class Album < ActiveRecord::Base
belongs_to :artist
has_many :tracks, :order => 'bonus ASC, position ASC', :dependent => :destroy
has_many :local_brainz_releases, :class_name => 'LocalBrainz::Release', :dependent => :destroy
end
+1
View File
@@ -1,3 +1,4 @@
class Artist < ActiveRecord::Base
has_many :albums, :order => 'has_pic DESC, year ASC, id ASC', :dependent => :destroy
has_many :artist_links, :dependent => :destroy
end
+3
View File
@@ -0,0 +1,3 @@
class ArtistLink < ActiveRecord::Base
belongs_to :artist
end
+5
View File
@@ -0,0 +1,5 @@
module LocalBrainz
def self.table_name_prefix
'local_brainz_'
end
end
+4
View File
@@ -0,0 +1,4 @@
class LocalBrainz::Release < ActiveRecord::Base
belongs_to :album, :class_name => 'Album'
has_many :local_brainz_tracks, :class_name => 'LocalBrainz::Track', :dependent => :destroy
end
+3
View File
@@ -0,0 +1,3 @@
class LocalBrainz::Track < ActiveRecord::Base
belongs_to :local_brainz_release, :class_name => 'LocalBrainz::Release'
end