{"action":"created","comment":{"url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/comments/78573964","id":78573964,"diff_hunk":"@@ -4,6 +4,15 @@ module.exports = db;\n \n // eslint-disable-next-line no-unused-vars\n var User = require('./models/user');\n+var Orders = require('./models/order');\n+var Cart = require('./models/cart');\n+var Payment = require('./models/payment');\n \n // if we had more models, we could associate them in this file\n // e.g. User.hasMany(Reports)\n+\n+Order.belongsTo(User);\n+Cart.belongsTo(User);\n+Cart.hasMany(Products);\n+Payment.belongsTo(Order);\n+","path":"server/db/index.js","position":15,"original_position":15,"commit_id":"cdae9c4e00896f4f11dafb4d7d2b2457e4e4000f","original_commit_id":"cdae9c4e00896f4f11dafb4d7d2b2457e4e4000f","user":{"login":"Dielentheis","id":11429494,"avatar_url":"https://avatars.githubusercontent.com/u/11429494?v=3","gravatar_id":"","url":"https://api.github.com/users/Dielentheis","html_url":"https://github.com/Dielentheis","followers_url":"https://api.github.com/users/Dielentheis/followers","following_url":"https://api.github.com/users/Dielentheis/following{/other_user}","gists_url":"https://api.github.com/users/Dielentheis/gists{/gist_id}","starred_url":"https://api.github.com/users/Dielentheis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dielentheis/subscriptions","organizations_url":"https://api.github.com/users/Dielentheis/orgs","repos_url":"https://api.github.com/users/Dielentheis/repos","events_url":"https://api.github.com/users/Dielentheis/events{/privacy}","received_events_url":"https://api.github.com/users/Dielentheis/received_events","type":"User","site_admin":false},"body":"BelongsTo is a one-to-one association and users can have multiple orders. \r\nhttp://docs.sequelizejs.com/en/latest/docs/associations/#one-to-many-associations\r\nmaybe change to User.hasMany(Order)","created_at":"2016-09-13T14:44:19Z","updated_at":"2016-09-13T14:44:19Z","html_url":"https://github.com/yuyingliu331/fsg/pull/3#discussion_r78573964","pull_request_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/comments/78573964"},"html":{"href":"https://github.com/yuyingliu331/fsg/pull/3#discussion_r78573964"},"pull_request":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3","id":84955577,"html_url":"https://github.com/yuyingliu331/fsg/pull/3","diff_url":"https://github.com/yuyingliu331/fsg/pull/3.diff","patch_url":"https://github.com/yuyingliu331/fsg/pull/3.patch","issue_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/3","number":3,"state":"open","locked":false,"title":"adding cart, order, payment, and user models","user":{"login":"masungwon","id":17363774,"avatar_url":"https://avatars.githubusercontent.com/u/17363774?v=3","gravatar_id":"","url":"https://api.github.com/users/masungwon","html_url":"https://github.com/masungwon","followers_url":"https://api.github.com/users/masungwon/followers","following_url":"https://api.github.com/users/masungwon/following{/other_user}","gists_url":"https://api.github.com/users/masungwon/gists{/gist_id}","starred_url":"https://api.github.com/users/masungwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masungwon/subscriptions","organizations_url":"https://api.github.com/users/masungwon/orgs","repos_url":"https://api.github.com/users/masungwon/repos","events_url":"https://api.github.com/users/masungwon/events{/privacy}","received_events_url":"https://api.github.com/users/masungwon/received_events","type":"User","site_admin":false},"body":"we have yet to add virtuals & validations; we need to double-check associations as well.","created_at":"2016-09-12T22:22:54Z","updated_at":"2016-09-13T14:44:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6a2ae91fbb563cdbc0bc89500e75fbe9eb3f913","assignee":{"login":"Dielentheis","id":11429494,"avatar_url":"https://avatars.githubusercontent.com/u/11429494?v=3","gravatar_id":"","url":"https://api.github.com/users/Dielentheis","html_url":"https://github.com/Dielentheis","followers_url":"https://api.github.com/users/Dielentheis/followers","following_url":"https://api.github.com/users/Dielentheis/following{/other_user}","gists_url":"https://api.github.com/users/Dielentheis/gists{/gist_id}","starred_url":"https://api.github.com/users/Dielentheis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dielentheis/subscriptions","organizations_url":"https://api.github.com/users/Dielentheis/orgs","repos_url":"https://api.github.com/users/Dielentheis/repos","events_url":"https://api.github.com/users/Dielentheis/events{/privacy}","received_events_url":"https://api.github.com/users/Dielentheis/received_events","type":"User","site_admin":false},"assignees":[{"login":"Dielentheis","id":11429494,"avatar_url":"https://avatars.githubusercontent.com/u/11429494?v=3","gravatar_id":"","url":"https://api.github.com/users/Dielentheis","html_url":"https://github.com/Dielentheis","followers_url":"https://api.github.com/users/Dielentheis/followers","following_url":"https://api.github.com/users/Dielentheis/following{/other_user}","gists_url":"https://api.github.com/users/Dielentheis/gists{/gist_id}","starred_url":"https://api.github.com/users/Dielentheis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dielentheis/subscriptions","organizations_url":"https://api.github.com/users/Dielentheis/orgs","repos_url":"https://api.github.com/users/Dielentheis/repos","events_url":"https://api.github.com/users/Dielentheis/events{/privacy}","received_events_url":"https://api.github.com/users/Dielentheis/received_events","type":"User","site_admin":false},{"login":"yuyingliu331","id":17233437,"avatar_url":"https://avatars.githubusercontent.com/u/17233437?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyingliu331","html_url":"https://github.com/yuyingliu331","followers_url":"https://api.github.com/users/yuyingliu331/followers","following_url":"https://api.github.com/users/yuyingliu331/following{/other_user}","gists_url":"https://api.github.com/users/yuyingliu331/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyingliu331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyingliu331/subscriptions","organizations_url":"https://api.github.com/users/yuyingliu331/orgs","repos_url":"https://api.github.com/users/yuyingliu331/repos","events_url":"https://api.github.com/users/yuyingliu331/events{/privacy}","received_events_url":"https://api.github.com/users/yuyingliu331/received_events","type":"User","site_admin":false},{"login":"BeeClip","id":20005130,"avatar_url":"https://avatars.githubusercontent.com/u/20005130?v=3","gravatar_id":"","url":"https://api.github.com/users/BeeClip","html_url":"https://github.com/BeeClip","followers_url":"https://api.github.com/users/BeeClip/followers","following_url":"https://api.github.com/users/BeeClip/following{/other_user}","gists_url":"https://api.github.com/users/BeeClip/gists{/gist_id}","starred_url":"https://api.github.com/users/BeeClip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BeeClip/subscriptions","organizations_url":"https://api.github.com/users/BeeClip/orgs","repos_url":"https://api.github.com/users/BeeClip/repos","events_url":"https://api.github.com/users/BeeClip/events{/privacy}","received_events_url":"https://api.github.com/users/BeeClip/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3/commits","review_comments_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3/comments","review_comment_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/3/comments","statuses_url":"https://api.github.com/repos/yuyingliu331/fsg/statuses/cdae9c4e00896f4f11dafb4d7d2b2457e4e4000f","head":{"label":"yuyingliu331:user","ref":"user","sha":"cdae9c4e00896f4f11dafb4d7d2b2457e4e4000f","user":{"login":"yuyingliu331","id":17233437,"avatar_url":"https://avatars.githubusercontent.com/u/17233437?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyingliu331","html_url":"https://github.com/yuyingliu331","followers_url":"https://api.github.com/users/yuyingliu331/followers","following_url":"https://api.github.com/users/yuyingliu331/following{/other_user}","gists_url":"https://api.github.com/users/yuyingliu331/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyingliu331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyingliu331/subscriptions","organizations_url":"https://api.github.com/users/yuyingliu331/orgs","repos_url":"https://api.github.com/users/yuyingliu331/repos","events_url":"https://api.github.com/users/yuyingliu331/events{/privacy}","received_events_url":"https://api.github.com/users/yuyingliu331/received_events","type":"User","site_admin":false},"repo":{"id":68017726,"name":"fsg","full_name":"yuyingliu331/fsg","owner":{"login":"yuyingliu331","id":17233437,"avatar_url":"https://avatars.githubusercontent.com/u/17233437?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyingliu331","html_url":"https://github.com/yuyingliu331","followers_url":"https://api.github.com/users/yuyingliu331/followers","following_url":"https://api.github.com/users/yuyingliu331/following{/other_user}","gists_url":"https://api.github.com/users/yuyingliu331/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyingliu331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyingliu331/subscriptions","organizations_url":"https://api.github.com/users/yuyingliu331/orgs","repos_url":"https://api.github.com/users/yuyingliu331/repos","events_url":"https://api.github.com/users/yuyingliu331/events{/privacy}","received_events_url":"https://api.github.com/users/yuyingliu331/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuyingliu331/fsg","description":null,"fork":false,"url":"https://api.github.com/repos/yuyingliu331/fsg","forks_url":"https://api.github.com/repos/yuyingliu331/fsg/forks","keys_url":"https://api.github.com/repos/yuyingliu331/fsg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuyingliu331/fsg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuyingliu331/fsg/teams","hooks_url":"https://api.github.com/repos/yuyingliu331/fsg/hooks","issue_events_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/events{/number}","events_url":"https://api.github.com/repos/yuyingliu331/fsg/events","assignees_url":"https://api.github.com/repos/yuyingliu331/fsg/assignees{/user}","branches_url":"https://api.github.com/repos/yuyingliu331/fsg/branches{/branch}","tags_url":"https://api.github.com/repos/yuyingliu331/fsg/tags","blobs_url":"https://api.github.com/repos/yuyingliu331/fsg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuyingliu331/fsg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuyingliu331/fsg/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuyingliu331/fsg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuyingliu331/fsg/statuses/{sha}","languages_url":"https://api.github.com/repos/yuyingliu331/fsg/languages","stargazers_url":"https://api.github.com/repos/yuyingliu331/fsg/stargazers","contributors_url":"https://api.github.com/repos/yuyingliu331/fsg/contributors","subscribers_url":"https://api.github.com/repos/yuyingliu331/fsg/subscribers","subscription_url":"https://api.github.com/repos/yuyingliu331/fsg/subscription","commits_url":"https://api.github.com/repos/yuyingliu331/fsg/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuyingliu331/fsg/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuyingliu331/fsg/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuyingliu331/fsg/contents/{+path}","compare_url":"https://api.github.com/repos/yuyingliu331/fsg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuyingliu331/fsg/merges","archive_url":"https://api.github.com/repos/yuyingliu331/fsg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuyingliu331/fsg/downloads","issues_url":"https://api.github.com/repos/yuyingliu331/fsg/issues{/number}","pulls_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls{/number}","milestones_url":"https://api.github.com/repos/yuyingliu331/fsg/milestones{/number}","notifications_url":"https://api.github.com/repos/yuyingliu331/fsg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuyingliu331/fsg/labels{/name}","releases_url":"https://api.github.com/repos/yuyingliu331/fsg/releases{/id}","deployments_url":"https://api.github.com/repos/yuyingliu331/fsg/deployments","created_at":"2016-09-12T14:41:50Z","updated_at":"2016-09-12T15:03:47Z","pushed_at":"2016-09-13T14:38:45Z","git_url":"git://github.com/yuyingliu331/fsg.git","ssh_url":"git@github.com:yuyingliu331/fsg.git","clone_url":"https://github.com/yuyingliu331/fsg.git","svn_url":"https://github.com/yuyingliu331/fsg","homepage":null,"size":44,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"yuyingliu331:master","ref":"master","sha":"6224c40b38c98ff65b9ae7ee2f39667755f41ca9","user":{"login":"yuyingliu331","id":17233437,"avatar_url":"https://avatars.githubusercontent.com/u/17233437?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyingliu331","html_url":"https://github.com/yuyingliu331","followers_url":"https://api.github.com/users/yuyingliu331/followers","following_url":"https://api.github.com/users/yuyingliu331/following{/other_user}","gists_url":"https://api.github.com/users/yuyingliu331/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyingliu331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyingliu331/subscriptions","organizations_url":"https://api.github.com/users/yuyingliu331/orgs","repos_url":"https://api.github.com/users/yuyingliu331/repos","events_url":"https://api.github.com/users/yuyingliu331/events{/privacy}","received_events_url":"https://api.github.com/users/yuyingliu331/received_events","type":"User","site_admin":false},"repo":{"id":68017726,"name":"fsg","full_name":"yuyingliu331/fsg","owner":{"login":"yuyingliu331","id":17233437,"avatar_url":"https://avatars.githubusercontent.com/u/17233437?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyingliu331","html_url":"https://github.com/yuyingliu331","followers_url":"https://api.github.com/users/yuyingliu331/followers","following_url":"https://api.github.com/users/yuyingliu331/following{/other_user}","gists_url":"https://api.github.com/users/yuyingliu331/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyingliu331/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyingliu331/subscriptions","organizations_url":"https://api.github.com/users/yuyingliu331/orgs","repos_url":"https://api.github.com/users/yuyingliu331/repos","events_url":"https://api.github.com/users/yuyingliu331/events{/privacy}","received_events_url":"https://api.github.com/users/yuyingliu331/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yuyingliu331/fsg","description":null,"fork":false,"url":"https://api.github.com/repos/yuyingliu331/fsg","forks_url":"https://api.github.com/repos/yuyingliu331/fsg/forks","keys_url":"https://api.github.com/repos/yuyingliu331/fsg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yuyingliu331/fsg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yuyingliu331/fsg/teams","hooks_url":"https://api.github.com/repos/yuyingliu331/fsg/hooks","issue_events_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/events{/number}","events_url":"https://api.github.com/repos/yuyingliu331/fsg/events","assignees_url":"https://api.github.com/repos/yuyingliu331/fsg/assignees{/user}","branches_url":"https://api.github.com/repos/yuyingliu331/fsg/branches{/branch}","tags_url":"https://api.github.com/repos/yuyingliu331/fsg/tags","blobs_url":"https://api.github.com/repos/yuyingliu331/fsg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yuyingliu331/fsg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yuyingliu331/fsg/git/refs{/sha}","trees_url":"https://api.github.com/repos/yuyingliu331/fsg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yuyingliu331/fsg/statuses/{sha}","languages_url":"https://api.github.com/repos/yuyingliu331/fsg/languages","stargazers_url":"https://api.github.com/repos/yuyingliu331/fsg/stargazers","contributors_url":"https://api.github.com/repos/yuyingliu331/fsg/contributors","subscribers_url":"https://api.github.com/repos/yuyingliu331/fsg/subscribers","subscription_url":"https://api.github.com/repos/yuyingliu331/fsg/subscription","commits_url":"https://api.github.com/repos/yuyingliu331/fsg/commits{/sha}","git_commits_url":"https://api.github.com/repos/yuyingliu331/fsg/git/commits{/sha}","comments_url":"https://api.github.com/repos/yuyingliu331/fsg/comments{/number}","issue_comment_url":"https://api.github.com/repos/yuyingliu331/fsg/issues/comments{/number}","contents_url":"https://api.github.com/repos/yuyingliu331/fsg/contents/{+path}","compare_url":"https://api.github.com/repos/yuyingliu331/fsg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yuyingliu331/fsg/merges","archive_url":"https://api.github.com/repos/yuyingliu331/fsg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yuyingliu331/fsg/downloads","issues_url":"https://api.github.com/repos/yuyingliu331/fsg/issues{/number}","pulls_url":"https://api.github.com/repos/yuyingliu331/fsg/pulls{/number}","milestones_url":"https://api.github.com/repos/yuyingliu331/fsg/milestones{/number}","notifications_url":"https://api.github.com/repos/yuyingliu331/fsg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yuyingliu331/fsg/labels{/name}","releases_url":"https://api.github.com/repos/yuyingliu331/fsg/releases{/id}","deployments_url":"https://api.github.com/repos/yuyingliu331/fsg/deployments","created_at":"2016-09-12T14:41:50Z","updated_at":"2016-09-12T15:03:47Z","pushed_at":"2016-09-13T14:38:45Z","git_url":"git://github.com/yuyingliu331/fsg.git","ssh_url":"git@github.com:yuyingliu331/fsg.git","clone_url":"https://github.com/yuyingliu331/fsg.git","svn_url":"https://github.com/yuyingliu331/fsg","homepage":null,"size":44,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3"},"html":{"href":"https://github.com/yuyingliu331/fsg/pull/3"},"issue":{"href":"https://api.github.com/repos/yuyingliu331/fsg/issues/3"},"comments":{"href":"https://api.github.com/repos/yuyingliu331/fsg/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yuyingliu331/fsg/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/yuyingliu331/fsg/statuses/cdae9c4e00896f4f11dafb4d7d2b2457e4e4000f"}}}}
{"actor":{"display_login":"Dielentheis"}}