{"action":"created","comment":{"url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/comments/143471707","pull_request_review_id":67987509,"id":143471707,"diff_hunk":"@@ -0,0 +1,87 @@\n+require 'harvester_utils/downloader'\n+\n+class Itms::SyncDiscrepancyJob < ItmsJob\n+  def perform(itms_id, downloader: HarvesterUtils::Downloader)\n+    response = downloader.get(\"https://opendata.itms2014.sk/v2/nezrovnalost/#{itms_id}\")\n+    json = JSON.parse(response.body)\n+\n+    ActiveRecord::Base.transaction do\n+      d = Itms::Discrepancy.find_or_initialize_by(itms_id: itms_id)\n+      d.itms_href = json['href']\n+      d.itms_created_at = json['createdAt']\n+      d.itms_updated_at = json['updatedAt']\n+      d.save!","path":"app/jobs/itms/sync_discrepancy_job.rb","position":13,"original_position":13,"commit_id":"7fe113f1e4dcdfeec17f1bae597728feedc1f2b0","original_commit_id":"7fe113f1e4dcdfeec17f1bae597728feedc1f2b0","user":{"login":"eronisko","id":1374745,"avatar_url":"https://avatars3.githubusercontent.com/u/1374745?v=4","gravatar_id":"","url":"https://api.github.com/users/eronisko","html_url":"https://github.com/eronisko","followers_url":"https://api.github.com/users/eronisko/followers","following_url":"https://api.github.com/users/eronisko/following{/other_user}","gists_url":"https://api.github.com/users/eronisko/gists{/gist_id}","starred_url":"https://api.github.com/users/eronisko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eronisko/subscriptions","organizations_url":"https://api.github.com/users/eronisko/orgs","repos_url":"https://api.github.com/users/eronisko/repos","events_url":"https://api.github.com/users/eronisko/events{/privacy}","received_events_url":"https://api.github.com/users/eronisko/received_events","type":"User","site_admin":false},"body":"@jsuchal Tymto (skory zapis nekompletneho zaznamu v transakcii) by som sa vyhol deadlockom (ked Objekt A potrebuje Objekt B a Objekt B potrebuje Objekt A).\r\n\r\nTakto mozem vytvorit vztahy v self-referential join tabulkach (napr. `nezrovnalost.suvisiace_nezrovnalosti`) predtym nez su tie objekty kompletne vyskladane.","created_at":"2017-10-09T13:46:29Z","updated_at":"2017-10-09T13:46:29Z","html_url":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23#discussion_r143471707","pull_request_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/comments/143471707"},"html":{"href":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23#discussion_r143471707"},"pull_request":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23","id":144998507,"html_url":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23","diff_url":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23.diff","patch_url":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23.patch","issue_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/23","number":23,"state":"open","locked":false,"title":"Pridavanie novych entit z ITMS API v2","user":{"login":"eronisko","id":1374745,"avatar_url":"https://avatars3.githubusercontent.com/u/1374745?v=4","gravatar_id":"","url":"https://api.github.com/users/eronisko","html_url":"https://github.com/eronisko","followers_url":"https://api.github.com/users/eronisko/followers","following_url":"https://api.github.com/users/eronisko/following{/other_user}","gists_url":"https://api.github.com/users/eronisko/gists{/gist_id}","starred_url":"https://api.github.com/users/eronisko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eronisko/subscriptions","organizations_url":"https://api.github.com/users/eronisko/orgs","repos_url":"https://api.github.com/users/eronisko/repos","events_url":"https://api.github.com/users/eronisko/events{/privacy}","received_events_url":"https://api.github.com/users/eronisko/received_events","type":"User","site_admin":false},"body":"Pridavanie novych entit z ITMS API v2 (#22)\r\n","created_at":"2017-10-05T19:18:00Z","updated_at":"2017-10-09T13:46:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdf1d7918f6c379adac5246683629daa088c6d6a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23/commits","review_comments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23/comments","review_comment_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/23/comments","statuses_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/statuses/7fe113f1e4dcdfeec17f1bae597728feedc1f2b0","head":{"label":"slovensko-digital:itms_new_entities","ref":"itms_new_entities","sha":"7fe113f1e4dcdfeec17f1bae597728feedc1f2b0","user":{"login":"slovensko-digital","id":16101866,"avatar_url":"https://avatars2.githubusercontent.com/u/16101866?v=4","gravatar_id":"","url":"https://api.github.com/users/slovensko-digital","html_url":"https://github.com/slovensko-digital","followers_url":"https://api.github.com/users/slovensko-digital/followers","following_url":"https://api.github.com/users/slovensko-digital/following{/other_user}","gists_url":"https://api.github.com/users/slovensko-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/slovensko-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slovensko-digital/subscriptions","organizations_url":"https://api.github.com/users/slovensko-digital/orgs","repos_url":"https://api.github.com/users/slovensko-digital/repos","events_url":"https://api.github.com/users/slovensko-digital/events{/privacy}","received_events_url":"https://api.github.com/users/slovensko-digital/received_events","type":"Organization","site_admin":false},"repo":{"id":70147339,"name":"harvester.ecosystem","full_name":"slovensko-digital/harvester.ecosystem","owner":{"login":"slovensko-digital","id":16101866,"avatar_url":"https://avatars2.githubusercontent.com/u/16101866?v=4","gravatar_id":"","url":"https://api.github.com/users/slovensko-digital","html_url":"https://github.com/slovensko-digital","followers_url":"https://api.github.com/users/slovensko-digital/followers","following_url":"https://api.github.com/users/slovensko-digital/following{/other_user}","gists_url":"https://api.github.com/users/slovensko-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/slovensko-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slovensko-digital/subscriptions","organizations_url":"https://api.github.com/users/slovensko-digital/orgs","repos_url":"https://api.github.com/users/slovensko-digital/repos","events_url":"https://api.github.com/users/slovensko-digital/events{/privacy}","received_events_url":"https://api.github.com/users/slovensko-digital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slovensko-digital/harvester.ecosystem","description":"App for pushing data to ekosystem.slovensko.digital","fork":false,"url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem","forks_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/forks","keys_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/teams","hooks_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/hooks","issue_events_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/events{/number}","events_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/events","assignees_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/assignees{/user}","branches_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/branches{/branch}","tags_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/tags","blobs_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/refs{/sha}","trees_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/statuses/{sha}","languages_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/languages","stargazers_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/stargazers","contributors_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/contributors","subscribers_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/subscribers","subscription_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/subscription","commits_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/commits{/sha}","git_commits_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/commits{/sha}","comments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/comments{/number}","issue_comment_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/comments{/number}","contents_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/contents/{+path}","compare_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/merges","archive_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/downloads","issues_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues{/number}","pulls_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls{/number}","milestones_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/milestones{/number}","notifications_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/labels{/name}","releases_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/releases{/id}","deployments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/deployments","created_at":"2016-10-06T11:23:11Z","updated_at":"2017-09-15T06:46:10Z","pushed_at":"2017-10-09T13:23:30Z","git_url":"git://github.com/slovensko-digital/harvester.ecosystem.git","ssh_url":"git@github.com:slovensko-digital/harvester.ecosystem.git","clone_url":"https://github.com/slovensko-digital/harvester.ecosystem.git","svn_url":"https://github.com/slovensko-digital/harvester.ecosystem","homepage":"https://ekosystem.slovensko.digital","size":447,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":13,"default_branch":"master"}},"base":{"label":"slovensko-digital:master","ref":"master","sha":"4f30a0d69099ba512161152c710df71d7e8ff7f3","user":{"login":"slovensko-digital","id":16101866,"avatar_url":"https://avatars2.githubusercontent.com/u/16101866?v=4","gravatar_id":"","url":"https://api.github.com/users/slovensko-digital","html_url":"https://github.com/slovensko-digital","followers_url":"https://api.github.com/users/slovensko-digital/followers","following_url":"https://api.github.com/users/slovensko-digital/following{/other_user}","gists_url":"https://api.github.com/users/slovensko-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/slovensko-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slovensko-digital/subscriptions","organizations_url":"https://api.github.com/users/slovensko-digital/orgs","repos_url":"https://api.github.com/users/slovensko-digital/repos","events_url":"https://api.github.com/users/slovensko-digital/events{/privacy}","received_events_url":"https://api.github.com/users/slovensko-digital/received_events","type":"Organization","site_admin":false},"repo":{"id":70147339,"name":"harvester.ecosystem","full_name":"slovensko-digital/harvester.ecosystem","owner":{"login":"slovensko-digital","id":16101866,"avatar_url":"https://avatars2.githubusercontent.com/u/16101866?v=4","gravatar_id":"","url":"https://api.github.com/users/slovensko-digital","html_url":"https://github.com/slovensko-digital","followers_url":"https://api.github.com/users/slovensko-digital/followers","following_url":"https://api.github.com/users/slovensko-digital/following{/other_user}","gists_url":"https://api.github.com/users/slovensko-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/slovensko-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slovensko-digital/subscriptions","organizations_url":"https://api.github.com/users/slovensko-digital/orgs","repos_url":"https://api.github.com/users/slovensko-digital/repos","events_url":"https://api.github.com/users/slovensko-digital/events{/privacy}","received_events_url":"https://api.github.com/users/slovensko-digital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slovensko-digital/harvester.ecosystem","description":"App for pushing data to ekosystem.slovensko.digital","fork":false,"url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem","forks_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/forks","keys_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/teams","hooks_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/hooks","issue_events_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/events{/number}","events_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/events","assignees_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/assignees{/user}","branches_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/branches{/branch}","tags_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/tags","blobs_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/refs{/sha}","trees_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/statuses/{sha}","languages_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/languages","stargazers_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/stargazers","contributors_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/contributors","subscribers_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/subscribers","subscription_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/subscription","commits_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/commits{/sha}","git_commits_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/git/commits{/sha}","comments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/comments{/number}","issue_comment_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/comments{/number}","contents_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/contents/{+path}","compare_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/merges","archive_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/downloads","issues_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues{/number}","pulls_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls{/number}","milestones_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/milestones{/number}","notifications_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/labels{/name}","releases_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/releases{/id}","deployments_url":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/deployments","created_at":"2016-10-06T11:23:11Z","updated_at":"2017-09-15T06:46:10Z","pushed_at":"2017-10-09T13:23:30Z","git_url":"git://github.com/slovensko-digital/harvester.ecosystem.git","ssh_url":"git@github.com:slovensko-digital/harvester.ecosystem.git","clone_url":"https://github.com/slovensko-digital/harvester.ecosystem.git","svn_url":"https://github.com/slovensko-digital/harvester.ecosystem","homepage":"https://ekosystem.slovensko.digital","size":447,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":10,"forks":6,"open_issues":10,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23"},"html":{"href":"https://github.com/slovensko-digital/harvester.ecosystem/pull/23"},"issue":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/23"},"comments":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/slovensko-digital/harvester.ecosystem/statuses/7fe113f1e4dcdfeec17f1bae597728feedc1f2b0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"eronisko"}}