{"action":"created","comment":{"url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/comments/29831481","id":29831481,"diff_hunk":"@@ -6,38 +5,60 @@\n //= require autonumeric\n //= require bootstrap-sprockets\n \n-$(document).on(\"keyup\", \"#contracts_search\", function() {\n+$(document).on(\"keyup\", \"#search_contract\", function() {\n+  $(\".status\").attr(\"disabled\",true);\n   $.get($(\"#contracts_search\").attr(\"action\"), $(\"#contracts_search\").serialize(), null, \"script\");\n     return false;\n });\n \n-function update_versions_div(path) {\n+function update_status_contract(path,id) {\n   $.ajax({\n     url: path,\n     type: \"PATCH\",\n-    data: {contract: {status: $(\"#update_status option:selected\").val()}  }\n+    dataType: \"script\",\n+    data: { contract: { status: $(\"#update_status_\" + id + \" option:selected\").val() } }\n+  });\n+}\n+\n+function update_status_invoice(path,id) {\n+  $.ajax({\n+    url: window.location.protocol + \"//\" + window.location.host + \"/\" + path,\n+    type: \"PATCH\",\n+    dataType: \"script\",\n+    data: { invoice: { status: $(\"#update_status_\" + id + \" option:selected\").val() } }\n   });\n }\n \n function update_date(path,id) {\n   $.ajax({\n-    url: path,\n+    url: window.location.protocol + \"//\" + window.location.host + \"/\" + path,\n     type: \"PATCH\",\n-    data: {invoice: {date_actual_payment: ($(\"#date-\" + id + \" #invoice_date_actual_payment_3i\").val() +\n+    dataType: \"script\",\n+    data: { invoice: { date_actual_payment: ($(\"#date-\" + id + \" #invoice_date_actual_payment_3i\").val() +\n       \"/\" + $(\"#date-\" + id + \" #invoice_date_actual_payment_2i\").val() +\n-      \"/\" + $(\"#date-\" + id + \" #invoice_date_actual_payment_1i\").val()) }}\n+      \"/\" + $(\"#date-\" + id + \" #invoice_date_actual_payment_1i\").val()) } }\n   });\n }\n \n function update_explanation(path,id) {\n   $.ajax({\n-    url: path,\n+    url: window.location.protocol + \"//\" + window.location.host + \"/\" + path,\n     type: \"PATCH\",\n-    data: {invoice: {explanation: $(\"#explanation-\" + id).val() }}\n+    dataType: \"script\",\n+    data: {invoice: {explanation: $(\"#explanation-\" + id).val() } }\n+  });\n+}\n+\n+function select_contract() {\n+  $.ajax({\n+    url: window.location.protocol + \"//\" + window.location.host + \"contracts/select_contract\",\n+    type: \"GET\",\n+    data: {contract_id: $(\"#invoice_contract_id\").val() }","path":"app/assets/javascripts/application.js","position":65,"original_position":65,"commit_id":"f1677d16fead109e12cd67826b89adab4603aa22","original_commit_id":"f1677d16fead109e12cd67826b89adab4603aa22","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Identifier 'contract_id' is not in camel case.","created_at":"2015-05-07T07:59:18Z","updated_at":"2015-05-07T07:59:18Z","html_url":"https://github.com/DemidenkoAndrey/documents/pull/4#discussion_r29831481","pull_request_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/comments/29831481"},"html":{"href":"https://github.com/DemidenkoAndrey/documents/pull/4#discussion_r29831481"},"pull_request":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4","id":34888085,"html_url":"https://github.com/DemidenkoAndrey/documents/pull/4","diff_url":"https://github.com/DemidenkoAndrey/documents/pull/4.diff","patch_url":"https://github.com/DemidenkoAndrey/documents/pull/4.patch","issue_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/4","number":4,"state":"open","locked":false,"title":"Add rolify","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-07T07:01:28Z","updated_at":"2015-05-07T07:59:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6966fcd63718796e3a5ba1a4515e28fb97941670","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4/commits","review_comments_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4/comments","review_comment_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/4/comments","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/documents/statuses/f1677d16fead109e12cd67826b89adab4603aa22","head":{"label":"DemidenkoAndrey:add-rolify","ref":"add-rolify","sha":"f1677d16fead109e12cd67826b89adab4603aa22","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"repo":{"id":33230491,"name":"documents","full_name":"DemidenkoAndrey/documents","owner":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DemidenkoAndrey/documents","description":"","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/documents","forks_url":"https://api.github.com/repos/DemidenkoAndrey/documents/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/documents/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/documents/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/documents/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/documents/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/documents/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/documents/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/documents/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/documents/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/documents/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/documents/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/documents/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/documents/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/documents/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/documents/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/documents/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/documents/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/documents/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/documents/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/documents/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/documents/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/documents/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/documents/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/documents/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/documents/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/documents/releases{/id}","created_at":"2015-04-01T06:25:42Z","updated_at":"2015-05-04T10:25:25Z","pushed_at":"2015-05-07T07:59:12Z","git_url":"git://github.com/DemidenkoAndrey/documents.git","ssh_url":"git@github.com:DemidenkoAndrey/documents.git","clone_url":"https://github.com/DemidenkoAndrey/documents.git","svn_url":"https://github.com/DemidenkoAndrey/documents","homepage":null,"size":3260,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":0,"default_branch":"master"}},"base":{"label":"DemidenkoAndrey:master","ref":"master","sha":"80f0fdd22f76f1e0799ee092e0e2cfefc790630e","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"repo":{"id":33230491,"name":"documents","full_name":"DemidenkoAndrey/documents","owner":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DemidenkoAndrey/documents","description":"","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/documents","forks_url":"https://api.github.com/repos/DemidenkoAndrey/documents/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/documents/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/documents/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/documents/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/documents/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/documents/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/documents/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/documents/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/documents/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/documents/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/documents/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/documents/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/documents/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/documents/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/documents/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/documents/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/documents/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/documents/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/documents/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/documents/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/documents/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/documents/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/documents/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/documents/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/documents/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/documents/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/documents/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/documents/releases{/id}","created_at":"2015-04-01T06:25:42Z","updated_at":"2015-05-04T10:25:25Z","pushed_at":"2015-05-07T07:59:12Z","git_url":"git://github.com/DemidenkoAndrey/documents.git","ssh_url":"git@github.com:DemidenkoAndrey/documents.git","clone_url":"https://github.com/DemidenkoAndrey/documents.git","svn_url":"https://github.com/DemidenkoAndrey/documents","homepage":null,"size":3260,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4"},"html":{"href":"https://github.com/DemidenkoAndrey/documents/pull/4"},"issue":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/4"},"comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/DemidenkoAndrey/documents/statuses/f1677d16fead109e12cd67826b89adab4603aa22"}}}}