lib/chinook_database/models/track.rb in chinook_database-0.1.4 vs lib/chinook_database/models/track.rb in chinook_database-0.1.5
- old
+ new
@@ -1,20 +1,6 @@
class Track < ActiveRecord::Base
- self.table_name = 'Track'
- self.primary_key = 'TrackId'
-
- alias_attribute :id, 'TrackId'
- alias_attribute :name, 'Name'
- alias_attribute :album_id, 'AlbumId'
- alias_attribute :media_type_id, 'MediaTypeId'
- alias_attribute :genre_id, 'GenreId'
- alias_attribute :composer, 'Composer'
- alias_attribute :milliseconds, 'Milliseconds'
- alias_attribute :bytes, 'Bytes'
- alias_attribute :unit_price, 'UnitPrice'
-
- belongs_to :album, foreign_key: 'AlbumId'
- belongs_to :media_type, foreign_key: 'MediaTypeId'
- belongs_to :genre, foreign_key: 'GenreId'
-
- has_and_belongs_to_many :playlists, join_table: 'PlaylistTrack', foreign_key: 'TrackId', association_foreign_key: 'PlaylistId'
+ belongs_to :album
+ belongs_to :media_type
+ belongs_to :genre
+ has_and_belongs_to_many :playlists
end
\ No newline at end of file