Skip to content

Instantly share code, notes, and snippets.

@edthix
Created November 3, 2009 02:57
Show Gist options
  • Save edthix/224736 to your computer and use it in GitHub Desktop.
Save edthix/224736 to your computer and use it in GitHub Desktop.
/*
Project has many Tasks
Tasks belongs to Project
Tables:
projects [id, name, date]
tasks [id, description, project_id]
*/
class Project extends AppModel {
var $name = 'Project';
var $hasMany = 'Task';
}
class Task extends AppModel {
var $name = 'Task';
var $belongsTo = 'Project'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment