Skip to content

Instantly share code, notes, and snippets.

@oleander
Created April 28, 2010 20:18
Show Gist options
  • Save oleander/382649 to your computer and use it in GitHub Desktop.
Save oleander/382649 to your computer and use it in GitHub Desktop.
class Channel < ActiveRecord::Base
has_many :songs
has_many :songs, :through => :gigs
has_many :toplists
has_many :playlists
validates_presence_of :name, :active
end
class Song < ActiveRecord::Base
has_one :artists
has_many :urls, :through => :songs_urls
end
class Gig < ActiveRecord::Base
belongs_to :channel
belongs_to :raw
belongs_to :artist
belongs_to :song
validates_presence_of :raw, :song, :artist, :channel, :time
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment