Skip to content

Instantly share code, notes, and snippets.

@hakagura
Created January 31, 2012 14:03
Show Gist options
  • Save hakagura/1710640 to your computer and use it in GitHub Desktop.
Save hakagura/1710640 to your computer and use it in GitHub Desktop.
Lógica:
Um _user_ deve ter vários _project_ e _tasks_
Um o _project_ deve ter várias _list_
Uma list deve ter várias _tasks_
USER has_many TASKS
USER has_many LISTS
TASK belongs_to USER
LIST belongs_to USER
PROJECT has_many LISTS
LIST has_many TASKS
PROJECT :name :user
LIST :name :description
TASK :description :status
Model:
Project :name :description :status
Task :name :user
User :details device
Lógica:
Project has_many Tasks
Task belongs_to Project
User has_many Projects
User has_many Tasks
rails g model project name:string description:text status:string user:references task:references
rails g model task name:string user:references project:references
User
has_many :tasks
has_many :projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment