Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created March 17, 2013 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemcalilly/9a16f43106c788ab6877 to your computer and use it in GitHub Desktop.
Save leemcalilly/9a16f43106c788ab6877 to your computer and use it in GitHub Desktop.
class Album < ActiveRecord::Base
attr_accessible :artist, :credits, :title, :year, :song_ids
belongs_to :user
has_many :albumizations
has_many :songs, :through => :albumizations
accepts_nested_attributes_for :songs
validates_presence_of :user_id
validates_presence_of :title
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment