Skip to content

Instantly share code, notes, and snippets.

@nixme
Forked from anonymous/gist:3085591
Created July 10, 2012 19:16
Show Gist options
  • Save nixme/3085601 to your computer and use it in GitHub Desktop.
Save nixme/3085601 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
attr_accessible :fb_id, :name, :profile_img_url, :spotify_id
has_many :votes
has_many :songs, through: :votes
end
class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :song
end
class Song < ActiveRecord::Base
attr_accessible :album_name, :artist_name, :name, :spotify_id, :spotify_url, :thumb_url
has_many :votes
has_many :users, through: :votes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment