Basic setting playlist

This commit is contained in:
magnolia-fan
2011-11-26 19:03:33 +04:00
parent 4ade7fa77f
commit 9a79ae0527
9 changed files with 61 additions and 19 deletions
+1
View File
@@ -1,4 +1,5 @@
class Playlist < ActiveRecord::Base
belongs_to :user
belongs_to :artist
has_many :playlist_items
end
+1
View File
@@ -3,6 +3,7 @@ class Artist < ActiveRecord::Base
has_many :artist_links, :dependent => :destroy
has_many :artist_aliases, :dependent => :destroy
has_many :tracks, :through => :track_artists
has_many :playlists
after_initialize :prepare_description
+1 -1
View File
@@ -2,7 +2,7 @@ class Track < ActiveRecord::Base
belongs_to :album
has_many :track_artists
has_many :artists, :through => :track_artists
@duration
has_many :playlist_items
def duration
if self.length