Skip to content

Instantly share code, notes, and snippets.

@jtperreault
Forked from telagraphic/project.rb
Created April 24, 2013 02:02
Show Gist options
  • Save jtperreault/5449035 to your computer and use it in GitHub Desktop.
Save jtperreault/5449035 to your computer and use it in GitHub Desktop.
class Project < ActiveRecord::Base
attr_accessible :description, :name
has_many :user_projects
has_many :users, :through => :user_projects
end
class User < ActiveRecord::Base
attr_accessible :email, :password, :password_confirmation
has_secure_password
validates_uniqueness_of :email
has_many :user_projects
has_many :projects, :through => :user_projects
end
class UserProject < ActiveRecord::Base
belongs_to :project
belongs_to :user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment