{"action":"created","comment":{"url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments/69401142","id":69401142,"diff_hunk":"@@ -4,6 +4,7 @@ class Item < ActiveRecord::Base\n   scope :priority, -> { order(\"item_categories.position ASC\") }\n   scope :latest, ->(num){ order(created_at: :asc).limit(num) }\n   scope :on_shelf, ->{ where(status: 0) }\n+  scope :item_id_in_stock, -> { joins(:stock).map(&:id).join(\"，\") }","path":"app/models/item.rb","position":4,"original_position":4,"commit_id":"a93097cb856967e3d7ed589d71e340a9e3b37461","original_commit_id":"a93097cb856967e3d7ed589d71e340a9e3b37461","user":{"login":"StevenKo","id":1100488,"avatar_url":"https://avatars.githubusercontent.com/u/1100488?v=3","gravatar_id":"","url":"https://api.github.com/users/StevenKo","html_url":"https://github.com/StevenKo","followers_url":"https://api.github.com/users/StevenKo/followers","following_url":"https://api.github.com/users/StevenKo/following{/other_user}","gists_url":"https://api.github.com/users/StevenKo/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenKo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenKo/subscriptions","organizations_url":"https://api.github.com/users/StevenKo/orgs","repos_url":"https://api.github.com/users/StevenKo/repos","events_url":"https://api.github.com/users/StevenKo/events{/privacy}","received_events_url":"https://api.github.com/users/StevenKo/received_events","type":"User","site_admin":false},"body":"scope 不要寫這種join, map , scope 是對model 的sql操作","created_at":"2016-07-04T01:32:42Z","updated_at":"2016-07-04T01:32:42Z","html_url":"https://github.com/kosbrother/mongmongwoo/pull/109#discussion_r69401142","pull_request_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments/69401142"},"html":{"href":"https://github.com/kosbrother/mongmongwoo/pull/109#discussion_r69401142"},"pull_request":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109","id":75773965,"html_url":"https://github.com/kosbrother/mongmongwoo/pull/109","diff_url":"https://github.com/kosbrother/mongmongwoo/pull/109.diff","patch_url":"https://github.com/kosbrother/mongmongwoo/pull/109.patch","issue_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/109","number":109,"state":"open","locked":false,"title":"Confirm admin cart items","user":{"login":"gvszg","id":7985560,"avatar_url":"https://avatars.githubusercontent.com/u/7985560?v=3","gravatar_id":"","url":"https://api.github.com/users/gvszg","html_url":"https://github.com/gvszg","followers_url":"https://api.github.com/users/gvszg/followers","following_url":"https://api.github.com/users/gvszg/following{/other_user}","gists_url":"https://api.github.com/users/gvszg/gists{/gist_id}","starred_url":"https://api.github.com/users/gvszg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvszg/subscriptions","organizations_url":"https://api.github.com/users/gvszg/orgs","repos_url":"https://api.github.com/users/gvszg/repos","events_url":"https://api.github.com/users/gvszg/events{/privacy}","received_events_url":"https://api.github.com/users/gvszg/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-30T07:47:02Z","updated_at":"2016-07-04T01:32:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6ccaa1b2a01cc2ede98f3dac0346b5433ae0644","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109/commits","review_comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109/comments","review_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/109/comments","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/a93097cb856967e3d7ed589d71e340a9e3b37461","head":{"label":"kosbrother:confirm-admin-cart-item","ref":"confirm-admin-cart-item","sha":"a93097cb856967e3d7ed589d71e340a9e3b37461","user":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"repo":{"id":56124462,"name":"mongmongwoo","full_name":"kosbrother/mongmongwoo","owner":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kosbrother/mongmongwoo","description":"","fork":false,"url":"https://api.github.com/repos/kosbrother/mongmongwoo","forks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/forks","keys_url":"https://api.github.com/repos/kosbrother/mongmongwoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kosbrother/mongmongwoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kosbrother/mongmongwoo/teams","hooks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/hooks","issue_events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/events{/number}","events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/events","assignees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/assignees{/user}","branches_url":"https://api.github.com/repos/kosbrother/mongmongwoo/branches{/branch}","tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/tags","blobs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/{sha}","languages_url":"https://api.github.com/repos/kosbrother/mongmongwoo/languages","stargazers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/stargazers","contributors_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contributors","subscribers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscribers","subscription_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscription","commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contents/{+path}","compare_url":"https://api.github.com/repos/kosbrother/mongmongwoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kosbrother/mongmongwoo/merges","archive_url":"https://api.github.com/repos/kosbrother/mongmongwoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kosbrother/mongmongwoo/downloads","issues_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues{/number}","pulls_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls{/number}","milestones_url":"https://api.github.com/repos/kosbrother/mongmongwoo/milestones{/number}","notifications_url":"https://api.github.com/repos/kosbrother/mongmongwoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kosbrother/mongmongwoo/labels{/name}","releases_url":"https://api.github.com/repos/kosbrother/mongmongwoo/releases{/id}","deployments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/deployments","created_at":"2016-04-13T05:46:41Z","updated_at":"2016-04-13T05:47:43Z","pushed_at":"2016-07-04T01:06:53Z","git_url":"git://github.com/kosbrother/mongmongwoo.git","ssh_url":"git@github.com:kosbrother/mongmongwoo.git","clone_url":"https://github.com/kosbrother/mongmongwoo.git","svn_url":"https://github.com/kosbrother/mongmongwoo","homepage":null,"size":4873,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"kosbrother:stock","ref":"stock","sha":"5bcb9ef802f220d3e965c3a26d8449c228e6500d","user":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"repo":{"id":56124462,"name":"mongmongwoo","full_name":"kosbrother/mongmongwoo","owner":{"login":"kosbrother","id":14856209,"avatar_url":"https://avatars.githubusercontent.com/u/14856209?v=3","gravatar_id":"","url":"https://api.github.com/users/kosbrother","html_url":"https://github.com/kosbrother","followers_url":"https://api.github.com/users/kosbrother/followers","following_url":"https://api.github.com/users/kosbrother/following{/other_user}","gists_url":"https://api.github.com/users/kosbrother/gists{/gist_id}","starred_url":"https://api.github.com/users/kosbrother/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosbrother/subscriptions","organizations_url":"https://api.github.com/users/kosbrother/orgs","repos_url":"https://api.github.com/users/kosbrother/repos","events_url":"https://api.github.com/users/kosbrother/events{/privacy}","received_events_url":"https://api.github.com/users/kosbrother/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kosbrother/mongmongwoo","description":"","fork":false,"url":"https://api.github.com/repos/kosbrother/mongmongwoo","forks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/forks","keys_url":"https://api.github.com/repos/kosbrother/mongmongwoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kosbrother/mongmongwoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kosbrother/mongmongwoo/teams","hooks_url":"https://api.github.com/repos/kosbrother/mongmongwoo/hooks","issue_events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/events{/number}","events_url":"https://api.github.com/repos/kosbrother/mongmongwoo/events","assignees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/assignees{/user}","branches_url":"https://api.github.com/repos/kosbrother/mongmongwoo/branches{/branch}","tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/tags","blobs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/{sha}","languages_url":"https://api.github.com/repos/kosbrother/mongmongwoo/languages","stargazers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/stargazers","contributors_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contributors","subscribers_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscribers","subscription_url":"https://api.github.com/repos/kosbrother/mongmongwoo/subscription","commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/kosbrother/mongmongwoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/kosbrother/mongmongwoo/contents/{+path}","compare_url":"https://api.github.com/repos/kosbrother/mongmongwoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kosbrother/mongmongwoo/merges","archive_url":"https://api.github.com/repos/kosbrother/mongmongwoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kosbrother/mongmongwoo/downloads","issues_url":"https://api.github.com/repos/kosbrother/mongmongwoo/issues{/number}","pulls_url":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls{/number}","milestones_url":"https://api.github.com/repos/kosbrother/mongmongwoo/milestones{/number}","notifications_url":"https://api.github.com/repos/kosbrother/mongmongwoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kosbrother/mongmongwoo/labels{/name}","releases_url":"https://api.github.com/repos/kosbrother/mongmongwoo/releases{/id}","deployments_url":"https://api.github.com/repos/kosbrother/mongmongwoo/deployments","created_at":"2016-04-13T05:46:41Z","updated_at":"2016-04-13T05:47:43Z","pushed_at":"2016-07-04T01:06:53Z","git_url":"git://github.com/kosbrother/mongmongwoo.git","ssh_url":"git@github.com:kosbrother/mongmongwoo.git","clone_url":"https://github.com/kosbrother/mongmongwoo.git","svn_url":"https://github.com/kosbrother/mongmongwoo","homepage":null,"size":4873,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109"},"html":{"href":"https://github.com/kosbrother/mongmongwoo/pull/109"},"issue":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/109"},"comments":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/kosbrother/mongmongwoo/statuses/a93097cb856967e3d7ed589d71e340a9e3b37461"}}}}
{"actor":{"display_login":"StevenKo"}}