{"action":"created","comment":{"url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/comments/111704158","pull_request_review_id":32963655,"id":111704158,"diff_hunk":"@@ -0,0 +1,70 @@\n+/**\n+ * Concurrently run our various dev tasks.\n+ *\n+ * Usage: node dev\n+ **/\n+\n+const app = require('.')\n+    , chalk = require('chalk'), {bold} = chalk\n+    , {red, green, blue, cyan, yellow} = bold\n+    , dev = module.exports = () => run({\n+      server: task(app.package.scripts['start-watch'], {color: blue}),\n+      build: task(app.package.scripts['build-watch'], {color: green}),\n+      lint: task(app.package.scripts['lint-watch'], {color: cyan}),\n+      test: task(app.package.scripts['test-watch'], {color: yellow})\n+    })\n+\n+function run(tasks) {\n+  Object.keys(tasks)\n+    .map(name => tasks[name](name, tasks[name]))","path":"dev.js","position":19,"original_position":19,"commit_id":"b24328adf4a5e34011c4346c7beef11d200d249b","original_commit_id":"b24328adf4a5e34011c4346c7beef11d200d249b","user":{"login":"glebec","id":7230206,"avatar_url":"https://avatars2.githubusercontent.com/u/7230206?v=3","gravatar_id":"","url":"https://api.github.com/users/glebec","html_url":"https://github.com/glebec","followers_url":"https://api.github.com/users/glebec/followers","following_url":"https://api.github.com/users/glebec/following{/other_user}","gists_url":"https://api.github.com/users/glebec/gists{/gist_id}","starred_url":"https://api.github.com/users/glebec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glebec/subscriptions","organizations_url":"https://api.github.com/users/glebec/orgs","repos_url":"https://api.github.com/users/glebec/repos","events_url":"https://api.github.com/users/glebec/events{/privacy}","received_events_url":"https://api.github.com/users/glebec/received_events","type":"User","site_admin":false},"body":"I think I might be missing something, I'm not sure why you're passing in a second argument to `tasks[name]`. It looks to me like `tasks[name]` will be the function on line 27, which only takes in a `name` param (and doesn't use rest op or `arguments`).","created_at":"2017-04-17T04:18:07Z","updated_at":"2017-04-17T04:18:08Z","html_url":"https://github.com/FullstackAcademy/bones/pull/84#discussion_r111704158","pull_request_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84","_links":{"self":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/comments/111704158"},"html":{"href":"https://github.com/FullstackAcademy/bones/pull/84#discussion_r111704158"},"pull_request":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84","id":116043891,"html_url":"https://github.com/FullstackAcademy/bones/pull/84","diff_url":"https://github.com/FullstackAcademy/bones/pull/84.diff","patch_url":"https://github.com/FullstackAcademy/bones/pull/84.patch","issue_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/84","number":84,"state":"open","locked":false,"title":"B/decyclicize models","user":{"login":"queerviolet","id":7763406,"avatar_url":"https://avatars0.githubusercontent.com/u/7763406?v=3","gravatar_id":"","url":"https://api.github.com/users/queerviolet","html_url":"https://github.com/queerviolet","followers_url":"https://api.github.com/users/queerviolet/followers","following_url":"https://api.github.com/users/queerviolet/following{/other_user}","gists_url":"https://api.github.com/users/queerviolet/gists{/gist_id}","starred_url":"https://api.github.com/users/queerviolet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queerviolet/subscriptions","organizations_url":"https://api.github.com/users/queerviolet/orgs","repos_url":"https://api.github.com/users/queerviolet/repos","events_url":"https://api.github.com/users/queerviolet/events{/privacy}","received_events_url":"https://api.github.com/users/queerviolet/received_events","type":"User","site_admin":false},"body":"Remove the cycle in how we define Sequelize models. It creates subtly nondeterministic behavior (which is what my momma warned me about, but I did it anyway, and now we must clean it up.).\r\n\r\nAnyway, we're back to injecting the database. This happens right after database initialization, and we now assign all the models to the db object itself.\r\n\r\nThat means that `require`ing model files directly is out, and this is in:\r\n\r\n```javascript\r\nconst {User, Product, Item} = require('APP/db')\r\n```\r\n\r\nWhich I actually quite like.\r\n\r\nAnother consequence is that associations are now defined in the model files, which may export an `associations` function which will receive the args `(self: Model, others: {[name]: Model})`. On the whole, models now look like this:\r\n\r\n```javascript\r\nconst {STRING, INTEGER} = require('sequelize')\r\n \r\nmodule.exports = db => db.define('items', {\r\n  name: STRING,\r\n  cents: INTEGER,\r\n})\r\n\r\nmodule.exports.associations = (Item, {Review}) => {\r\n  Item.hasMany(Review)\r\n}\r\n```","created_at":"2017-04-16T00:35:26Z","updated_at":"2017-04-17T04:18:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"280b3eca5760cdaf8c2688a35230c04a81b92cce","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84/commits","review_comments_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84/comments","review_comment_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/84/comments","statuses_url":"https://api.github.com/repos/FullstackAcademy/bones/statuses/b24328adf4a5e34011c4346c7beef11d200d249b","head":{"label":"FullstackAcademy:b/decyclicize-models","ref":"b/decyclicize-models","sha":"b24328adf4a5e34011c4346c7beef11d200d249b","user":{"login":"FullstackAcademy","id":5460509,"avatar_url":"https://avatars0.githubusercontent.com/u/5460509?v=3","gravatar_id":"","url":"https://api.github.com/users/FullstackAcademy","html_url":"https://github.com/FullstackAcademy","followers_url":"https://api.github.com/users/FullstackAcademy/followers","following_url":"https://api.github.com/users/FullstackAcademy/following{/other_user}","gists_url":"https://api.github.com/users/FullstackAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/FullstackAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FullstackAcademy/subscriptions","organizations_url":"https://api.github.com/users/FullstackAcademy/orgs","repos_url":"https://api.github.com/users/FullstackAcademy/repos","events_url":"https://api.github.com/users/FullstackAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/FullstackAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":72208196,"name":"bones","full_name":"FullstackAcademy/bones","owner":{"login":"FullstackAcademy","id":5460509,"avatar_url":"https://avatars0.githubusercontent.com/u/5460509?v=3","gravatar_id":"","url":"https://api.github.com/users/FullstackAcademy","html_url":"https://github.com/FullstackAcademy","followers_url":"https://api.github.com/users/FullstackAcademy/followers","following_url":"https://api.github.com/users/FullstackAcademy/following{/other_user}","gists_url":"https://api.github.com/users/FullstackAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/FullstackAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FullstackAcademy/subscriptions","organizations_url":"https://api.github.com/users/FullstackAcademy/orgs","repos_url":"https://api.github.com/users/FullstackAcademy/repos","events_url":"https://api.github.com/users/FullstackAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/FullstackAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FullstackAcademy/bones","description":"App skeleton for fun and profit","fork":true,"url":"https://api.github.com/repos/FullstackAcademy/bones","forks_url":"https://api.github.com/repos/FullstackAcademy/bones/forks","keys_url":"https://api.github.com/repos/FullstackAcademy/bones/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FullstackAcademy/bones/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FullstackAcademy/bones/teams","hooks_url":"https://api.github.com/repos/FullstackAcademy/bones/hooks","issue_events_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/events{/number}","events_url":"https://api.github.com/repos/FullstackAcademy/bones/events","assignees_url":"https://api.github.com/repos/FullstackAcademy/bones/assignees{/user}","branches_url":"https://api.github.com/repos/FullstackAcademy/bones/branches{/branch}","tags_url":"https://api.github.com/repos/FullstackAcademy/bones/tags","blobs_url":"https://api.github.com/repos/FullstackAcademy/bones/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FullstackAcademy/bones/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FullstackAcademy/bones/git/refs{/sha}","trees_url":"https://api.github.com/repos/FullstackAcademy/bones/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FullstackAcademy/bones/statuses/{sha}","languages_url":"https://api.github.com/repos/FullstackAcademy/bones/languages","stargazers_url":"https://api.github.com/repos/FullstackAcademy/bones/stargazers","contributors_url":"https://api.github.com/repos/FullstackAcademy/bones/contributors","subscribers_url":"https://api.github.com/repos/FullstackAcademy/bones/subscribers","subscription_url":"https://api.github.com/repos/FullstackAcademy/bones/subscription","commits_url":"https://api.github.com/repos/FullstackAcademy/bones/commits{/sha}","git_commits_url":"https://api.github.com/repos/FullstackAcademy/bones/git/commits{/sha}","comments_url":"https://api.github.com/repos/FullstackAcademy/bones/comments{/number}","issue_comment_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/comments{/number}","contents_url":"https://api.github.com/repos/FullstackAcademy/bones/contents/{+path}","compare_url":"https://api.github.com/repos/FullstackAcademy/bones/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FullstackAcademy/bones/merges","archive_url":"https://api.github.com/repos/FullstackAcademy/bones/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FullstackAcademy/bones/downloads","issues_url":"https://api.github.com/repos/FullstackAcademy/bones/issues{/number}","pulls_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls{/number}","milestones_url":"https://api.github.com/repos/FullstackAcademy/bones/milestones{/number}","notifications_url":"https://api.github.com/repos/FullstackAcademy/bones/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FullstackAcademy/bones/labels{/name}","releases_url":"https://api.github.com/repos/FullstackAcademy/bones/releases{/id}","deployments_url":"https://api.github.com/repos/FullstackAcademy/bones/deployments","created_at":"2016-10-28T13:07:33Z","updated_at":"2017-04-02T19:45:13Z","pushed_at":"2017-04-16T06:29:15Z","git_url":"git://github.com/FullstackAcademy/bones.git","ssh_url":"git@github.com:FullstackAcademy/bones.git","clone_url":"https://github.com/FullstackAcademy/bones.git","svn_url":"https://github.com/FullstackAcademy/bones","homepage":"","size":287,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":9,"forks":68,"open_issues":9,"watchers":23,"default_branch":"master"}},"base":{"label":"FullstackAcademy:master","ref":"master","sha":"750105f900a53b327e333168433ede39fdfe1f64","user":{"login":"FullstackAcademy","id":5460509,"avatar_url":"https://avatars0.githubusercontent.com/u/5460509?v=3","gravatar_id":"","url":"https://api.github.com/users/FullstackAcademy","html_url":"https://github.com/FullstackAcademy","followers_url":"https://api.github.com/users/FullstackAcademy/followers","following_url":"https://api.github.com/users/FullstackAcademy/following{/other_user}","gists_url":"https://api.github.com/users/FullstackAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/FullstackAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FullstackAcademy/subscriptions","organizations_url":"https://api.github.com/users/FullstackAcademy/orgs","repos_url":"https://api.github.com/users/FullstackAcademy/repos","events_url":"https://api.github.com/users/FullstackAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/FullstackAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":72208196,"name":"bones","full_name":"FullstackAcademy/bones","owner":{"login":"FullstackAcademy","id":5460509,"avatar_url":"https://avatars0.githubusercontent.com/u/5460509?v=3","gravatar_id":"","url":"https://api.github.com/users/FullstackAcademy","html_url":"https://github.com/FullstackAcademy","followers_url":"https://api.github.com/users/FullstackAcademy/followers","following_url":"https://api.github.com/users/FullstackAcademy/following{/other_user}","gists_url":"https://api.github.com/users/FullstackAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/FullstackAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FullstackAcademy/subscriptions","organizations_url":"https://api.github.com/users/FullstackAcademy/orgs","repos_url":"https://api.github.com/users/FullstackAcademy/repos","events_url":"https://api.github.com/users/FullstackAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/FullstackAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FullstackAcademy/bones","description":"App skeleton for fun and profit","fork":true,"url":"https://api.github.com/repos/FullstackAcademy/bones","forks_url":"https://api.github.com/repos/FullstackAcademy/bones/forks","keys_url":"https://api.github.com/repos/FullstackAcademy/bones/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FullstackAcademy/bones/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FullstackAcademy/bones/teams","hooks_url":"https://api.github.com/repos/FullstackAcademy/bones/hooks","issue_events_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/events{/number}","events_url":"https://api.github.com/repos/FullstackAcademy/bones/events","assignees_url":"https://api.github.com/repos/FullstackAcademy/bones/assignees{/user}","branches_url":"https://api.github.com/repos/FullstackAcademy/bones/branches{/branch}","tags_url":"https://api.github.com/repos/FullstackAcademy/bones/tags","blobs_url":"https://api.github.com/repos/FullstackAcademy/bones/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FullstackAcademy/bones/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FullstackAcademy/bones/git/refs{/sha}","trees_url":"https://api.github.com/repos/FullstackAcademy/bones/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FullstackAcademy/bones/statuses/{sha}","languages_url":"https://api.github.com/repos/FullstackAcademy/bones/languages","stargazers_url":"https://api.github.com/repos/FullstackAcademy/bones/stargazers","contributors_url":"https://api.github.com/repos/FullstackAcademy/bones/contributors","subscribers_url":"https://api.github.com/repos/FullstackAcademy/bones/subscribers","subscription_url":"https://api.github.com/repos/FullstackAcademy/bones/subscription","commits_url":"https://api.github.com/repos/FullstackAcademy/bones/commits{/sha}","git_commits_url":"https://api.github.com/repos/FullstackAcademy/bones/git/commits{/sha}","comments_url":"https://api.github.com/repos/FullstackAcademy/bones/comments{/number}","issue_comment_url":"https://api.github.com/repos/FullstackAcademy/bones/issues/comments{/number}","contents_url":"https://api.github.com/repos/FullstackAcademy/bones/contents/{+path}","compare_url":"https://api.github.com/repos/FullstackAcademy/bones/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FullstackAcademy/bones/merges","archive_url":"https://api.github.com/repos/FullstackAcademy/bones/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FullstackAcademy/bones/downloads","issues_url":"https://api.github.com/repos/FullstackAcademy/bones/issues{/number}","pulls_url":"https://api.github.com/repos/FullstackAcademy/bones/pulls{/number}","milestones_url":"https://api.github.com/repos/FullstackAcademy/bones/milestones{/number}","notifications_url":"https://api.github.com/repos/FullstackAcademy/bones/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FullstackAcademy/bones/labels{/name}","releases_url":"https://api.github.com/repos/FullstackAcademy/bones/releases{/id}","deployments_url":"https://api.github.com/repos/FullstackAcademy/bones/deployments","created_at":"2016-10-28T13:07:33Z","updated_at":"2017-04-02T19:45:13Z","pushed_at":"2017-04-16T06:29:15Z","git_url":"git://github.com/FullstackAcademy/bones.git","ssh_url":"git@github.com:FullstackAcademy/bones.git","clone_url":"https://github.com/FullstackAcademy/bones.git","svn_url":"https://github.com/FullstackAcademy/bones","homepage":"","size":287,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":9,"forks":68,"open_issues":9,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84"},"html":{"href":"https://github.com/FullstackAcademy/bones/pull/84"},"issue":{"href":"https://api.github.com/repos/FullstackAcademy/bones/issues/84"},"comments":{"href":"https://api.github.com/repos/FullstackAcademy/bones/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FullstackAcademy/bones/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/FullstackAcademy/bones/statuses/b24328adf4a5e34011c4346c7beef11d200d249b"}}}}
{"actor":{"display_login":"glebec"}}