Sha256: e66a2a5ed7ad17e6b5c45b4a4cc3fbb6aaee2fe17af78a164a3bb0cc1f2c22b5

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

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 :play_lists, join_table: 'PlayListTrack', foreign_key: 'TrackId', association_foreign_key: 'PlayListId'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chinook_database-0.1.3 lib/chinook_database/models/track.rb
chinook_database-0.1.2 lib/chinook_database/models/track.rb