{"action":"created","comment":{"url":"https://api.github.com/repos/4-hills/tracker/pulls/comments/31832766","id":31832766,"diff_hunk":"@@ -0,0 +1,74 @@\n+module Api\n+  module V1\n+    class WorkItems < Grape::API\n+      version 'v1' # path-based versioning by default\n+      format :json\n+\n+      resource :work_items do\n+        desc \"Return LIST of work_items\", { entity: Api::V1::Entities::WorkItem }\n+        get do\n+          #User.all\n+          present :work_items, WorkItem.all, with: Api::V1::Entities::WorkItem\n+        end\n+\n+        desc \"CREATES a work_item\"\n+        params do\n+          requires :name\n+          requires :status\n+          requires :user_id\n+        end\n+        post do\n+          user = User.find(params[:user_id])\n+          work_item = WorkItem.create(name: params[:name],\n+                                      description: params[:description],\n+                                      status: params[:status],","path":"lib/api/v1/work_items.rb","position":24,"original_position":24,"commit_id":"27ffe26bad4dc0c1f8cc681b05eb8536bed81795","original_commit_id":"27ffe26bad4dc0c1f8cc681b05eb8536bed81795","user":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"body":"It will be null. It is not validated in the model, so I did it following that logic.","created_at":"2015-06-05T17:23:04Z","updated_at":"2015-06-05T17:23:04Z","html_url":"https://github.com/4-hills/tracker/pull/1#discussion_r31832766","pull_request_url":"https://api.github.com/repos/4-hills/tracker/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/comments/31832766"},"html":{"href":"https://github.com/4-hills/tracker/pull/1#discussion_r31832766"},"pull_request":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/4-hills/tracker/pulls/1","id":37047585,"html_url":"https://github.com/4-hills/tracker/pull/1","diff_url":"https://github.com/4-hills/tracker/pull/1.diff","patch_url":"https://github.com/4-hills/tracker/pull/1.patch","issue_url":"https://api.github.com/repos/4-hills/tracker/issues/1","number":1,"state":"open","locked":false,"title":"Work item endopoints","user":{"login":"leosoubeste","id":2564586,"avatar_url":"https://avatars.githubusercontent.com/u/2564586?v=3","gravatar_id":"","url":"https://api.github.com/users/leosoubeste","html_url":"https://github.com/leosoubeste","followers_url":"https://api.github.com/users/leosoubeste/followers","following_url":"https://api.github.com/users/leosoubeste/following{/other_user}","gists_url":"https://api.github.com/users/leosoubeste/gists{/gist_id}","starred_url":"https://api.github.com/users/leosoubeste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leosoubeste/subscriptions","organizations_url":"https://api.github.com/users/leosoubeste/orgs","repos_url":"https://api.github.com/users/leosoubeste/repos","events_url":"https://api.github.com/users/leosoubeste/events{/privacy}","received_events_url":"https://api.github.com/users/leosoubeste/received_events","type":"User","site_admin":false},"body":"Created Get, Put, Patch, Post, Delete methods for work item entity.","created_at":"2015-06-05T16:30:48Z","updated_at":"2015-06-05T17:23:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6690b518f6c8301ab994e04152bf2c9928662373","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/4-hills/tracker/pulls/1/commits","review_comments_url":"https://api.github.com/repos/4-hills/tracker/pulls/1/comments","review_comment_url":"https://api.github.com/repos/4-hills/tracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/4-hills/tracker/issues/1/comments","statuses_url":"https://api.github.com/repos/4-hills/tracker/statuses/27ffe26bad4dc0c1f8cc681b05eb8536bed81795","head":{"label":"4-hills:work_item_endopoints","ref":"work_item_endopoints","sha":"27ffe26bad4dc0c1f8cc681b05eb8536bed81795","user":{"login":"4-hills","id":9207599,"avatar_url":"https://avatars.githubusercontent.com/u/9207599?v=3","gravatar_id":"","url":"https://api.github.com/users/4-hills","html_url":"https://github.com/4-hills","followers_url":"https://api.github.com/users/4-hills/followers","following_url":"https://api.github.com/users/4-hills/following{/other_user}","gists_url":"https://api.github.com/users/4-hills/gists{/gist_id}","starred_url":"https://api.github.com/users/4-hills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4-hills/subscriptions","organizations_url":"https://api.github.com/users/4-hills/orgs","repos_url":"https://api.github.com/users/4-hills/repos","events_url":"https://api.github.com/users/4-hills/events{/privacy}","received_events_url":"https://api.github.com/users/4-hills/received_events","type":"Organization","site_admin":false},"repo":{"id":36669024,"name":"tracker","full_name":"4-hills/tracker","owner":{"login":"4-hills","id":9207599,"avatar_url":"https://avatars.githubusercontent.com/u/9207599?v=3","gravatar_id":"","url":"https://api.github.com/users/4-hills","html_url":"https://github.com/4-hills","followers_url":"https://api.github.com/users/4-hills/followers","following_url":"https://api.github.com/users/4-hills/following{/other_user}","gists_url":"https://api.github.com/users/4-hills/gists{/gist_id}","starred_url":"https://api.github.com/users/4-hills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4-hills/subscriptions","organizations_url":"https://api.github.com/users/4-hills/orgs","repos_url":"https://api.github.com/users/4-hills/repos","events_url":"https://api.github.com/users/4-hills/events{/privacy}","received_events_url":"https://api.github.com/users/4-hills/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4-hills/tracker","description":"Training App to learn Ruby, Rails, RSPec, Grape and Angular JS","fork":false,"url":"https://api.github.com/repos/4-hills/tracker","forks_url":"https://api.github.com/repos/4-hills/tracker/forks","keys_url":"https://api.github.com/repos/4-hills/tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4-hills/tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4-hills/tracker/teams","hooks_url":"https://api.github.com/repos/4-hills/tracker/hooks","issue_events_url":"https://api.github.com/repos/4-hills/tracker/issues/events{/number}","events_url":"https://api.github.com/repos/4-hills/tracker/events","assignees_url":"https://api.github.com/repos/4-hills/tracker/assignees{/user}","branches_url":"https://api.github.com/repos/4-hills/tracker/branches{/branch}","tags_url":"https://api.github.com/repos/4-hills/tracker/tags","blobs_url":"https://api.github.com/repos/4-hills/tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4-hills/tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4-hills/tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/4-hills/tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4-hills/tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/4-hills/tracker/languages","stargazers_url":"https://api.github.com/repos/4-hills/tracker/stargazers","contributors_url":"https://api.github.com/repos/4-hills/tracker/contributors","subscribers_url":"https://api.github.com/repos/4-hills/tracker/subscribers","subscription_url":"https://api.github.com/repos/4-hills/tracker/subscription","commits_url":"https://api.github.com/repos/4-hills/tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/4-hills/tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/4-hills/tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/4-hills/tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/4-hills/tracker/contents/{+path}","compare_url":"https://api.github.com/repos/4-hills/tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4-hills/tracker/merges","archive_url":"https://api.github.com/repos/4-hills/tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4-hills/tracker/downloads","issues_url":"https://api.github.com/repos/4-hills/tracker/issues{/number}","pulls_url":"https://api.github.com/repos/4-hills/tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/4-hills/tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/4-hills/tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4-hills/tracker/labels{/name}","releases_url":"https://api.github.com/repos/4-hills/tracker/releases{/id}","created_at":"2015-06-01T15:14:15Z","updated_at":"2015-06-02T17:33:50Z","pushed_at":"2015-06-05T16:30:48Z","git_url":"git://github.com/4-hills/tracker.git","ssh_url":"git@github.com:4-hills/tracker.git","clone_url":"https://github.com/4-hills/tracker.git","svn_url":"https://github.com/4-hills/tracker","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"4-hills:master","ref":"master","sha":"3787bf1324e7f0b0a9b4022c71825bb9eb695614","user":{"login":"4-hills","id":9207599,"avatar_url":"https://avatars.githubusercontent.com/u/9207599?v=3","gravatar_id":"","url":"https://api.github.com/users/4-hills","html_url":"https://github.com/4-hills","followers_url":"https://api.github.com/users/4-hills/followers","following_url":"https://api.github.com/users/4-hills/following{/other_user}","gists_url":"https://api.github.com/users/4-hills/gists{/gist_id}","starred_url":"https://api.github.com/users/4-hills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4-hills/subscriptions","organizations_url":"https://api.github.com/users/4-hills/orgs","repos_url":"https://api.github.com/users/4-hills/repos","events_url":"https://api.github.com/users/4-hills/events{/privacy}","received_events_url":"https://api.github.com/users/4-hills/received_events","type":"Organization","site_admin":false},"repo":{"id":36669024,"name":"tracker","full_name":"4-hills/tracker","owner":{"login":"4-hills","id":9207599,"avatar_url":"https://avatars.githubusercontent.com/u/9207599?v=3","gravatar_id":"","url":"https://api.github.com/users/4-hills","html_url":"https://github.com/4-hills","followers_url":"https://api.github.com/users/4-hills/followers","following_url":"https://api.github.com/users/4-hills/following{/other_user}","gists_url":"https://api.github.com/users/4-hills/gists{/gist_id}","starred_url":"https://api.github.com/users/4-hills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4-hills/subscriptions","organizations_url":"https://api.github.com/users/4-hills/orgs","repos_url":"https://api.github.com/users/4-hills/repos","events_url":"https://api.github.com/users/4-hills/events{/privacy}","received_events_url":"https://api.github.com/users/4-hills/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4-hills/tracker","description":"Training App to learn Ruby, Rails, RSPec, Grape and Angular JS","fork":false,"url":"https://api.github.com/repos/4-hills/tracker","forks_url":"https://api.github.com/repos/4-hills/tracker/forks","keys_url":"https://api.github.com/repos/4-hills/tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4-hills/tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4-hills/tracker/teams","hooks_url":"https://api.github.com/repos/4-hills/tracker/hooks","issue_events_url":"https://api.github.com/repos/4-hills/tracker/issues/events{/number}","events_url":"https://api.github.com/repos/4-hills/tracker/events","assignees_url":"https://api.github.com/repos/4-hills/tracker/assignees{/user}","branches_url":"https://api.github.com/repos/4-hills/tracker/branches{/branch}","tags_url":"https://api.github.com/repos/4-hills/tracker/tags","blobs_url":"https://api.github.com/repos/4-hills/tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4-hills/tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4-hills/tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/4-hills/tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4-hills/tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/4-hills/tracker/languages","stargazers_url":"https://api.github.com/repos/4-hills/tracker/stargazers","contributors_url":"https://api.github.com/repos/4-hills/tracker/contributors","subscribers_url":"https://api.github.com/repos/4-hills/tracker/subscribers","subscription_url":"https://api.github.com/repos/4-hills/tracker/subscription","commits_url":"https://api.github.com/repos/4-hills/tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/4-hills/tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/4-hills/tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/4-hills/tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/4-hills/tracker/contents/{+path}","compare_url":"https://api.github.com/repos/4-hills/tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4-hills/tracker/merges","archive_url":"https://api.github.com/repos/4-hills/tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4-hills/tracker/downloads","issues_url":"https://api.github.com/repos/4-hills/tracker/issues{/number}","pulls_url":"https://api.github.com/repos/4-hills/tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/4-hills/tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/4-hills/tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4-hills/tracker/labels{/name}","releases_url":"https://api.github.com/repos/4-hills/tracker/releases{/id}","created_at":"2015-06-01T15:14:15Z","updated_at":"2015-06-02T17:33:50Z","pushed_at":"2015-06-05T16:30:48Z","git_url":"git://github.com/4-hills/tracker.git","ssh_url":"git@github.com:4-hills/tracker.git","clone_url":"https://github.com/4-hills/tracker.git","svn_url":"https://github.com/4-hills/tracker","homepage":null,"size":0,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/1"},"html":{"href":"https://github.com/4-hills/tracker/pull/1"},"issue":{"href":"https://api.github.com/repos/4-hills/tracker/issues/1"},"comments":{"href":"https://api.github.com/repos/4-hills/tracker/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/4-hills/tracker/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/4-hills/tracker/statuses/27ffe26bad4dc0c1f8cc681b05eb8536bed81795"}}}}