{"action":"created","comment":{"url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/23613612","id":23613612,"diff_hunk":"@@ -98,6 +98,15 @@ def complete_review\n       render json: @offer, serializer: serializer\n     end\n \n+    api :PUT, '/v1/offers/1/close_offer', \"Mark Offer as closed.\"\n+    param :offer, Hash, required: true do\n+      param :state_event, String, \"State transition event ex: 'close'\", required: true\n+    end\n+    def close_offer\n+      @offer.update_attributes(review_offer_params)\n+      render json: @offer, serializer: serializer\n+    end\n+","path":"app/controllers/api/v1/offers_controller.rb","position":12,"original_position":12,"commit_id":"9c5abef325b48cc160282b833451cb0fe5ffdfa8","original_commit_id":"9c5abef325b48cc160282b833451cb0fe5ffdfa8","user":{"login":"steveyken","id":149198,"avatar_url":"https://avatars.githubusercontent.com/u/149198?v=3","gravatar_id":"","url":"https://api.github.com/users/steveyken","html_url":"https://github.com/steveyken","followers_url":"https://api.github.com/users/steveyken/followers","following_url":"https://api.github.com/users/steveyken/following{/other_user}","gists_url":"https://api.github.com/users/steveyken/gists{/gist_id}","starred_url":"https://api.github.com/users/steveyken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveyken/subscriptions","organizations_url":"https://api.github.com/users/steveyken/orgs","repos_url":"https://api.github.com/users/steveyken/repos","events_url":"https://api.github.com/users/steveyken/events{/privacy}","received_events_url":"https://api.github.com/users/steveyken/received_events","type":"User","site_admin":false},"body":"@swatijadhav ```complete_review``` and ```close_offer``` are exactly the same method. Could you DRY the up a bit? Thanks","created_at":"2015-01-27T15:08:33Z","updated_at":"2015-01-27T15:08:33Z","html_url":"https://github.com/crossroads/api.goodcity/pull/47#discussion_r23613612","pull_request_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/23613612"},"html":{"href":"https://github.com/crossroads/api.goodcity/pull/47#discussion_r23613612"},"pull_request":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47","id":28100824,"html_url":"https://github.com/crossroads/api.goodcity/pull/47","diff_url":"https://github.com/crossroads/api.goodcity/pull/47.diff","patch_url":"https://github.com/crossroads/api.goodcity/pull/47.patch","issue_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/47","number":47,"state":"closed","locked":false,"title":"mark offer as closed by reviewer or supervisor","user":{"login":"swatijadhav","id":1950768,"avatar_url":"https://avatars.githubusercontent.com/u/1950768?v=3","gravatar_id":"","url":"https://api.github.com/users/swatijadhav","html_url":"https://github.com/swatijadhav","followers_url":"https://api.github.com/users/swatijadhav/followers","following_url":"https://api.github.com/users/swatijadhav/following{/other_user}","gists_url":"https://api.github.com/users/swatijadhav/gists{/gist_id}","starred_url":"https://api.github.com/users/swatijadhav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swatijadhav/subscriptions","organizations_url":"https://api.github.com/users/swatijadhav/orgs","repos_url":"https://api.github.com/users/swatijadhav/repos","events_url":"https://api.github.com/users/swatijadhav/events{/privacy}","received_events_url":"https://api.github.com/users/swatijadhav/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-27T11:19:57Z","updated_at":"2015-01-27T15:08:33Z","closed_at":"2015-01-27T11:20:13Z","merged_at":"2015-01-27T11:20:13Z","merge_commit_sha":"fd27fcaf2459a65a020a4f60cdecc4c3d469642e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47/commits","review_comments_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47/comments","review_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/{number}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/47/comments","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/9c5abef325b48cc160282b833451cb0fe5ffdfa8","head":{"label":"crossroads:close-offer","ref":"close-offer","sha":"9c5abef325b48cc160282b833451cb0fe5ffdfa8","user":{"login":"crossroads","id":141971,"avatar_url":"https://avatars.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"repo":{"id":21196107,"name":"api.goodcity","full_name":"crossroads/api.goodcity","owner":{"login":"crossroads","id":141971,"avatar_url":"https://avatars.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossroads/api.goodcity","description":"Good City API server","fork":false,"url":"https://api.github.com/repos/crossroads/api.goodcity","forks_url":"https://api.github.com/repos/crossroads/api.goodcity/forks","keys_url":"https://api.github.com/repos/crossroads/api.goodcity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossroads/api.goodcity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossroads/api.goodcity/teams","hooks_url":"https://api.github.com/repos/crossroads/api.goodcity/hooks","issue_events_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/events{/number}","events_url":"https://api.github.com/repos/crossroads/api.goodcity/events","assignees_url":"https://api.github.com/repos/crossroads/api.goodcity/assignees{/user}","branches_url":"https://api.github.com/repos/crossroads/api.goodcity/branches{/branch}","tags_url":"https://api.github.com/repos/crossroads/api.goodcity/tags","blobs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossroads/api.goodcity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossroads/api.goodcity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/{sha}","languages_url":"https://api.github.com/repos/crossroads/api.goodcity/languages","stargazers_url":"https://api.github.com/repos/crossroads/api.goodcity/stargazers","contributors_url":"https://api.github.com/repos/crossroads/api.goodcity/contributors","subscribers_url":"https://api.github.com/repos/crossroads/api.goodcity/subscribers","subscription_url":"https://api.github.com/repos/crossroads/api.goodcity/subscription","commits_url":"https://api.github.com/repos/crossroads/api.goodcity/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossroads/api.goodcity/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/comments/{number}","contents_url":"https://api.github.com/repos/crossroads/api.goodcity/contents/{+path}","compare_url":"https://api.github.com/repos/crossroads/api.goodcity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossroads/api.goodcity/merges","archive_url":"https://api.github.com/repos/crossroads/api.goodcity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossroads/api.goodcity/downloads","issues_url":"https://api.github.com/repos/crossroads/api.goodcity/issues{/number}","pulls_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls{/number}","milestones_url":"https://api.github.com/repos/crossroads/api.goodcity/milestones{/number}","notifications_url":"https://api.github.com/repos/crossroads/api.goodcity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossroads/api.goodcity/labels{/name}","releases_url":"https://api.github.com/repos/crossroads/api.goodcity/releases{/id}","created_at":"2014-06-25T08:40:40Z","updated_at":"2015-01-27T12:52:09Z","pushed_at":"2015-01-27T12:52:08Z","git_url":"git://github.com/crossroads/api.goodcity.git","ssh_url":"git@github.com:crossroads/api.goodcity.git","clone_url":"https://github.com/crossroads/api.goodcity.git","svn_url":"https://github.com/crossroads/api.goodcity","homepage":"http://api.goodcity.hk","size":3740,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"crossroads:master","ref":"master","sha":"6f61150d5d36a6b2212eb5b205db90efcd463c67","user":{"login":"crossroads","id":141971,"avatar_url":"https://avatars.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"repo":{"id":21196107,"name":"api.goodcity","full_name":"crossroads/api.goodcity","owner":{"login":"crossroads","id":141971,"avatar_url":"https://avatars.githubusercontent.com/u/141971?v=3","gravatar_id":"","url":"https://api.github.com/users/crossroads","html_url":"https://github.com/crossroads","followers_url":"https://api.github.com/users/crossroads/followers","following_url":"https://api.github.com/users/crossroads/following{/other_user}","gists_url":"https://api.github.com/users/crossroads/gists{/gist_id}","starred_url":"https://api.github.com/users/crossroads/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crossroads/subscriptions","organizations_url":"https://api.github.com/users/crossroads/orgs","repos_url":"https://api.github.com/users/crossroads/repos","events_url":"https://api.github.com/users/crossroads/events{/privacy}","received_events_url":"https://api.github.com/users/crossroads/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crossroads/api.goodcity","description":"Good City API server","fork":false,"url":"https://api.github.com/repos/crossroads/api.goodcity","forks_url":"https://api.github.com/repos/crossroads/api.goodcity/forks","keys_url":"https://api.github.com/repos/crossroads/api.goodcity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crossroads/api.goodcity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crossroads/api.goodcity/teams","hooks_url":"https://api.github.com/repos/crossroads/api.goodcity/hooks","issue_events_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/events{/number}","events_url":"https://api.github.com/repos/crossroads/api.goodcity/events","assignees_url":"https://api.github.com/repos/crossroads/api.goodcity/assignees{/user}","branches_url":"https://api.github.com/repos/crossroads/api.goodcity/branches{/branch}","tags_url":"https://api.github.com/repos/crossroads/api.goodcity/tags","blobs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crossroads/api.goodcity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crossroads/api.goodcity/git/refs{/sha}","trees_url":"https://api.github.com/repos/crossroads/api.goodcity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crossroads/api.goodcity/statuses/{sha}","languages_url":"https://api.github.com/repos/crossroads/api.goodcity/languages","stargazers_url":"https://api.github.com/repos/crossroads/api.goodcity/stargazers","contributors_url":"https://api.github.com/repos/crossroads/api.goodcity/contributors","subscribers_url":"https://api.github.com/repos/crossroads/api.goodcity/subscribers","subscription_url":"https://api.github.com/repos/crossroads/api.goodcity/subscription","commits_url":"https://api.github.com/repos/crossroads/api.goodcity/commits{/sha}","git_commits_url":"https://api.github.com/repos/crossroads/api.goodcity/git/commits{/sha}","comments_url":"https://api.github.com/repos/crossroads/api.goodcity/comments{/number}","issue_comment_url":"https://api.github.com/repos/crossroads/api.goodcity/issues/comments/{number}","contents_url":"https://api.github.com/repos/crossroads/api.goodcity/contents/{+path}","compare_url":"https://api.github.com/repos/crossroads/api.goodcity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crossroads/api.goodcity/merges","archive_url":"https://api.github.com/repos/crossroads/api.goodcity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crossroads/api.goodcity/downloads","issues_url":"https://api.github.com/repos/crossroads/api.goodcity/issues{/number}","pulls_url":"https://api.github.com/repos/crossroads/api.goodcity/pulls{/number}","milestones_url":"https://api.github.com/repos/crossroads/api.goodcity/milestones{/number}","notifications_url":"https://api.github.com/repos/crossroads/api.goodcity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crossroads/api.goodcity/labels{/name}","releases_url":"https://api.github.com/repos/crossroads/api.goodcity/releases{/id}","created_at":"2014-06-25T08:40:40Z","updated_at":"2015-01-27T12:52:09Z","pushed_at":"2015-01-27T12:52:08Z","git_url":"git://github.com/crossroads/api.goodcity.git","ssh_url":"git@github.com:crossroads/api.goodcity.git","clone_url":"https://github.com/crossroads/api.goodcity.git","svn_url":"https://github.com/crossroads/api.goodcity","homepage":"http://api.goodcity.hk","size":3740,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47"},"html":{"href":"https://github.com/crossroads/api.goodcity/pull/47"},"issue":{"href":"https://api.github.com/repos/crossroads/api.goodcity/issues/47"},"comments":{"href":"https://api.github.com/repos/crossroads/api.goodcity/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/crossroads/api.goodcity/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/crossroads/api.goodcity/statuses/9c5abef325b48cc160282b833451cb0fe5ffdfa8"}}}}