{"action":"created","issue":{"url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/147","labels_url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/147/comments","events_url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/147/events","html_url":"https://github.com/TIY-DC-ROR-2015-Jan/course-notes/issues/147","id":57486394,"number":147,"title":"Todos","user":{"login":"jamesdabbs","id":1079270,"avatar_url":"https://avatars.githubusercontent.com/u/1079270?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesdabbs","html_url":"https://github.com/jamesdabbs","followers_url":"https://api.github.com/users/jamesdabbs/followers","following_url":"https://api.github.com/users/jamesdabbs/following{/other_user}","gists_url":"https://api.github.com/users/jamesdabbs/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesdabbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesdabbs/subscriptions","organizations_url":"https://api.github.com/users/jamesdabbs/orgs","repos_url":"https://api.github.com/users/jamesdabbs/repos","events_url":"https://api.github.com/users/jamesdabbs/events{/privacy}","received_events_url":"https://api.github.com/users/jamesdabbs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/labels/homework","name":"homework","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"rob-hutchinson","id":10606672,"avatar_url":"https://avatars.githubusercontent.com/u/10606672?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-hutchinson","html_url":"https://github.com/rob-hutchinson","followers_url":"https://api.github.com/users/rob-hutchinson/followers","following_url":"https://api.github.com/users/rob-hutchinson/following{/other_user}","gists_url":"https://api.github.com/users/rob-hutchinson/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-hutchinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-hutchinson/subscriptions","organizations_url":"https://api.github.com/users/rob-hutchinson/orgs","repos_url":"https://api.github.com/users/rob-hutchinson/repos","events_url":"https://api.github.com/users/rob-hutchinson/events{/privacy}","received_events_url":"https://api.github.com/users/rob-hutchinson/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-02-12T16:50:20Z","updated_at":"2015-02-17T03:08:20Z","closed_at":"2015-02-17T03:08:20Z","body":"_Due on Feb 17 @ 09:00am_\n## Objectives\n\n### Learning Objectives\n\nAfter completing this assignment, you should understand:\n\n* Developing larger applications that interact with a database\n* How to define and leverage relations to simplify database interactions\n\n### Performance Objectives\n\nAfter completing this assignment, you be able to effectively use\n\n* Schema migrations and `ActiveRecord` models to interact with data\n* `belongs_to`, `has_many` and `has_many_through` to define relationship\n* The query methods generated by the above\n\n## Details\n\n### Deliverables\n\nA repo (based on [our class skeleton](https://github.com/TIY-DC-ROR-2015-Jan/model-skeleton)) with a `todo` script with several subcommands.\n\n## Normal Mode\n\nStart a new project, and [enable logging](https://github.com/TIY-DC-ROR-2015-Jan/course-notes/commit/7712209624ffa823ace8b24cebe70c3f0f9a184d).\n\nIn this mode, each todo item belongs to a single list. Declare and use ActiveRecord relations wherever possible.\n\nImplement the following subcommands\n\n* `add [list name] [todo item]` adds a todo item to a list (creating the list, if needed)\n* `due [n] [time]` marks a todo item as due on the given date\n* `done [n]` marks the todo item with id n as done\n* `list` shows all incomplete todo items\n* `list [name]` shows only items from the given list\n* `list all` shows all items, including completed ones (with some visual cue for what is complete)\n* `next` picks and shows a random item (choosing one with a due date if there are any)\n* `search [string]` shows todo items containing the given string\n\n\n## Hard Mode\n\nAny of the following:\n\n* Add users, who must \"log in\" before editing, and who each have their own lists and items\n* Use [thor](https://github.com/erikhuda/thor) to make a better command line interface\n* Add more sorting and filtering options for list: recently created, by name, past due, etc.\n* Keep track of when items are completed, and add an option to display statistics about them\n\n# References\n\n* Read the [ActiveRecord associations guide](http://guides.rubyonrails.org/association_basics.html)\n* See [my example refactoring of Gifbot](https://github.com/TIY-DC-ROR-2015-Jan/course-notes/commit/4ce7e1bf2a6c22caf8ff0130ac1cb6db33c2ba72) to use relations"},"comment":{"url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/comments/74610805","html_url":"https://github.com/TIY-DC-ROR-2015-Jan/course-notes/issues/147#issuecomment-74610805","issue_url":"https://api.github.com/repos/TIY-DC-ROR-2015-Jan/course-notes/issues/147","id":74610805,"user":{"login":"rob-hutchinson","id":10606672,"avatar_url":"https://avatars.githubusercontent.com/u/10606672?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-hutchinson","html_url":"https://github.com/rob-hutchinson","followers_url":"https://api.github.com/users/rob-hutchinson/followers","following_url":"https://api.github.com/users/rob-hutchinson/following{/other_user}","gists_url":"https://api.github.com/users/rob-hutchinson/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-hutchinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-hutchinson/subscriptions","organizations_url":"https://api.github.com/users/rob-hutchinson/orgs","repos_url":"https://api.github.com/users/rob-hutchinson/repos","events_url":"https://api.github.com/users/rob-hutchinson/events{/privacy}","received_events_url":"https://api.github.com/users/rob-hutchinson/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T03:08:20Z","updated_at":"2015-02-17T03:08:20Z","body":"https://github.com/rob-hutchinson/to_do_list\r\n\r\nI tried to include Thor but it couldn't seem to figure out the table commands inside of the Thor class. Is there some way to pass the tables in? I ended up just defining each of the possible commands in Thor by pointing them to a function outside of Thor that could actually interact with the tables but I feel like there must be a better way."}}