{"action":"created","comment":{"url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/comments/50110506","id":50110506,"diff_hunk":"@@ -84,16 +130,28 @@ def holiday_params\n   end\n \n   def calculate_leave(operator, length)\n-    length_last_year = (current_user.remaining_leave_last_year - length > 0) ? (current_user.remaining_leave_last_year - length) : current_user.remaining_leave_last_year\n-    current_user.update_attribute(:remaining_leave_last_year, current_user.remaining_leave_last_year.send(operator, length_last_year))\n-    current_user.update_attribute(:remaining_leave, current_user.remaining_leave.send(operator, length))\n+    length_last_year = (@holiday.user.remaining_leave_last_year.send(operator, length) > 0) ? (@holiday.user.remaining_leave_last_year.send(operator, length)) : 0\n+    @holiday.user.update_attribute(:remaining_leave_last_year, length_last_year)\n+    @holiday.user.update_attribute(:remaining_leave, @holiday.user.remaining_leave.send(operator, length))\n   end\n \n   def add_leave(length)\n-    calculate_leave(:+, length)\n+    updated_remaining_leave_last_year = @holiday.user.remaining_leave_last_year + @holiday.length_last_year\n+    user = @holiday.user\n+    user.update_attributes(remaining_leave_last_year: updated_remaining_leave_last_year, remaining_leave: @holiday.user.remaining_leave + length)\n+    user.valid?","path":"app/controllers/holidays_controller.rb","position":162,"original_position":162,"commit_id":"8c50735145cf9705cc7d0e7487aa0d1dffb4ed86","original_commit_id":"8c50735145cf9705cc7d0e7487aa0d1dffb4ed86","user":{"login":"WGierke","id":6676439,"avatar_url":"https://avatars.githubusercontent.com/u/6676439?v=3","gravatar_id":"","url":"https://api.github.com/users/WGierke","html_url":"https://github.com/WGierke","followers_url":"https://api.github.com/users/WGierke/followers","following_url":"https://api.github.com/users/WGierke/following{/other_user}","gists_url":"https://api.github.com/users/WGierke/gists{/gist_id}","starred_url":"https://api.github.com/users/WGierke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGierke/subscriptions","organizations_url":"https://api.github.com/users/WGierke/orgs","repos_url":"https://api.github.com/users/WGierke/repos","events_url":"https://api.github.com/users/WGierke/events{/privacy}","received_events_url":"https://api.github.com/users/WGierke/received_events","type":"User","site_admin":false},"body":"Wird mit dem Rückgabewert hier noch etwas angefangen?","created_at":"2016-01-19T13:20:22Z","updated_at":"2016-01-19T13:20:22Z","html_url":"https://github.com/hpi-swt2/wimi-portal/pull/200#discussion_r50110506","pull_request_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200","_links":{"self":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/comments/50110506"},"html":{"href":"https://github.com/hpi-swt2/wimi-portal/pull/200#discussion_r50110506"},"pull_request":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200"}}},"pull_request":{"url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200","id":56292941,"html_url":"https://github.com/hpi-swt2/wimi-portal/pull/200","diff_url":"https://github.com/hpi-swt2/wimi-portal/pull/200.diff","patch_url":"https://github.com/hpi-swt2/wimi-portal/pull/200.patch","issue_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/200","number":200,"state":"open","locked":false,"title":"Feature/57 representative holiday","user":{"login":"Tymolc","id":9571607,"avatar_url":"https://avatars.githubusercontent.com/u/9571607?v=3","gravatar_id":"","url":"https://api.github.com/users/Tymolc","html_url":"https://github.com/Tymolc","followers_url":"https://api.github.com/users/Tymolc/followers","following_url":"https://api.github.com/users/Tymolc/following{/other_user}","gists_url":"https://api.github.com/users/Tymolc/gists{/gist_id}","starred_url":"https://api.github.com/users/Tymolc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tymolc/subscriptions","organizations_url":"https://api.github.com/users/Tymolc/orgs","repos_url":"https://api.github.com/users/Tymolc/repos","events_url":"https://api.github.com/users/Tymolc/events{/privacy}","received_events_url":"https://api.github.com/users/Tymolc/received_events","type":"User","site_admin":false},"body":"#151 \r\n\r\nAkzeptanztkriterium\r\n\r\n- Das Start- und End-Datum passt sich der gewählten Sprache an dd.mm.yyyy für Deutsch mm/dd/yyyy für Englisch\r\n\r\n#57 \r\n\r\nAls Beauftragter eines Fachgebiets möchte ich auf dem Profil eines Wimis seine bisherigen Urlaubsanträge einsehen und bestätigen können und die verfügbaren Urlaubstage bearbeiten können.\r\n\r\nBestätige ich den Urlaubsantrag eines Wimis und hat dieser einen Vertreter für die Zeit festgelegt, erhält der Vertreter eine Benachrichtigung darüber auf seinem Dashboard.\r\n\r\nAkzeptanzkriterien\r\n\r\n- Auf dem Profil eines Wimis wird dem FG-Beauftragten die bisherigen Urlaubsanträge angezeigt, mit Link zur jeweiligen Detailseite.\r\n- Der Beauftragte des Fachgebiets kann die Anzahl der verfügbaren Urlaubstage ändern (wie Wimi selbst, siehe #53).\r\n\r\n#223 \r\n\r\nUrlaubsanträge können jetzt auch rückwirkend gestellt werden.\r\n\r\n#201 \r\n\r\n//Urlaubsanträge können auf dem Profil nur von Wimis gesehen/gestellt werden.\r\nWurde wohl auch auf dem Dev bereits implementiert. Hier ist jetzt eine abgewandelte Version drin, weil ich das ja auch bereits gemacht habe und nicht alles neu schreiben wollte ... ","created_at":"2016-01-18T00:45:39Z","updated_at":"2016-01-19T13:20:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"199f5f97bc069f67050dace5e08952c4d9ac232d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200/commits","review_comments_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200/comments","review_comment_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/200/comments","statuses_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/statuses/8c50735145cf9705cc7d0e7487aa0d1dffb4ed86","head":{"label":"hpi-swt2:feature/57_representative_holiday","ref":"feature/57_representative_holiday","sha":"8c50735145cf9705cc7d0e7487aa0d1dffb4ed86","user":{"login":"hpi-swt2","id":6618414,"avatar_url":"https://avatars.githubusercontent.com/u/6618414?v=3","gravatar_id":"","url":"https://api.github.com/users/hpi-swt2","html_url":"https://github.com/hpi-swt2","followers_url":"https://api.github.com/users/hpi-swt2/followers","following_url":"https://api.github.com/users/hpi-swt2/following{/other_user}","gists_url":"https://api.github.com/users/hpi-swt2/gists{/gist_id}","starred_url":"https://api.github.com/users/hpi-swt2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpi-swt2/subscriptions","organizations_url":"https://api.github.com/users/hpi-swt2/orgs","repos_url":"https://api.github.com/users/hpi-swt2/repos","events_url":"https://api.github.com/users/hpi-swt2/events{/privacy}","received_events_url":"https://api.github.com/users/hpi-swt2/received_events","type":"Organization","site_admin":false},"repo":{"id":42998928,"name":"wimi-portal","full_name":"hpi-swt2/wimi-portal","owner":{"login":"hpi-swt2","id":6618414,"avatar_url":"https://avatars.githubusercontent.com/u/6618414?v=3","gravatar_id":"","url":"https://api.github.com/users/hpi-swt2","html_url":"https://github.com/hpi-swt2","followers_url":"https://api.github.com/users/hpi-swt2/followers","following_url":"https://api.github.com/users/hpi-swt2/following{/other_user}","gists_url":"https://api.github.com/users/hpi-swt2/gists{/gist_id}","starred_url":"https://api.github.com/users/hpi-swt2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpi-swt2/subscriptions","organizations_url":"https://api.github.com/users/hpi-swt2/orgs","repos_url":"https://api.github.com/users/hpi-swt2/repos","events_url":"https://api.github.com/users/hpi-swt2/events{/privacy}","received_events_url":"https://api.github.com/users/hpi-swt2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpi-swt2/wimi-portal","description":"","fork":false,"url":"https://api.github.com/repos/hpi-swt2/wimi-portal","forks_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/forks","keys_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/teams","hooks_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/hooks","issue_events_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/events{/number}","events_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/events","assignees_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/assignees{/user}","branches_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/branches{/branch}","tags_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/tags","blobs_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/languages","stargazers_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/stargazers","contributors_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/contributors","subscribers_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/subscribers","subscription_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/subscription","commits_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/contents/{+path}","compare_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/merges","archive_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/downloads","issues_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues{/number}","pulls_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/labels{/name}","releases_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/releases{/id}","created_at":"2015-09-23T12:17:35Z","updated_at":"2016-01-13T13:56:07Z","pushed_at":"2016-01-19T10:26:57Z","git_url":"git://github.com/hpi-swt2/wimi-portal.git","ssh_url":"git@github.com:hpi-swt2/wimi-portal.git","clone_url":"https://github.com/hpi-swt2/wimi-portal.git","svn_url":"https://github.com/hpi-swt2/wimi-portal","homepage":"","size":2189,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":85,"forks":0,"open_issues":85,"watchers":6,"default_branch":"master"}},"base":{"label":"hpi-swt2:team3review","ref":"team3review","sha":"edf5a78b60c6e05be90298e5d88d9564e749c1d1","user":{"login":"hpi-swt2","id":6618414,"avatar_url":"https://avatars.githubusercontent.com/u/6618414?v=3","gravatar_id":"","url":"https://api.github.com/users/hpi-swt2","html_url":"https://github.com/hpi-swt2","followers_url":"https://api.github.com/users/hpi-swt2/followers","following_url":"https://api.github.com/users/hpi-swt2/following{/other_user}","gists_url":"https://api.github.com/users/hpi-swt2/gists{/gist_id}","starred_url":"https://api.github.com/users/hpi-swt2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpi-swt2/subscriptions","organizations_url":"https://api.github.com/users/hpi-swt2/orgs","repos_url":"https://api.github.com/users/hpi-swt2/repos","events_url":"https://api.github.com/users/hpi-swt2/events{/privacy}","received_events_url":"https://api.github.com/users/hpi-swt2/received_events","type":"Organization","site_admin":false},"repo":{"id":42998928,"name":"wimi-portal","full_name":"hpi-swt2/wimi-portal","owner":{"login":"hpi-swt2","id":6618414,"avatar_url":"https://avatars.githubusercontent.com/u/6618414?v=3","gravatar_id":"","url":"https://api.github.com/users/hpi-swt2","html_url":"https://github.com/hpi-swt2","followers_url":"https://api.github.com/users/hpi-swt2/followers","following_url":"https://api.github.com/users/hpi-swt2/following{/other_user}","gists_url":"https://api.github.com/users/hpi-swt2/gists{/gist_id}","starred_url":"https://api.github.com/users/hpi-swt2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpi-swt2/subscriptions","organizations_url":"https://api.github.com/users/hpi-swt2/orgs","repos_url":"https://api.github.com/users/hpi-swt2/repos","events_url":"https://api.github.com/users/hpi-swt2/events{/privacy}","received_events_url":"https://api.github.com/users/hpi-swt2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpi-swt2/wimi-portal","description":"","fork":false,"url":"https://api.github.com/repos/hpi-swt2/wimi-portal","forks_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/forks","keys_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/teams","hooks_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/hooks","issue_events_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/events{/number}","events_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/events","assignees_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/assignees{/user}","branches_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/branches{/branch}","tags_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/tags","blobs_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/statuses/{sha}","languages_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/languages","stargazers_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/stargazers","contributors_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/contributors","subscribers_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/subscribers","subscription_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/subscription","commits_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/contents/{+path}","compare_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/merges","archive_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/downloads","issues_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues{/number}","pulls_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls{/number}","milestones_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/milestones{/number}","notifications_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/labels{/name}","releases_url":"https://api.github.com/repos/hpi-swt2/wimi-portal/releases{/id}","created_at":"2015-09-23T12:17:35Z","updated_at":"2016-01-13T13:56:07Z","pushed_at":"2016-01-19T10:26:57Z","git_url":"git://github.com/hpi-swt2/wimi-portal.git","ssh_url":"git@github.com:hpi-swt2/wimi-portal.git","clone_url":"https://github.com/hpi-swt2/wimi-portal.git","svn_url":"https://github.com/hpi-swt2/wimi-portal","homepage":"","size":2189,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":85,"forks":0,"open_issues":85,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200"},"html":{"href":"https://github.com/hpi-swt2/wimi-portal/pull/200"},"issue":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/200"},"comments":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/issues/200/comments"},"review_comments":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200/comments"},"review_comment":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/pulls/200/commits"},"statuses":{"href":"https://api.github.com/repos/hpi-swt2/wimi-portal/statuses/8c50735145cf9705cc7d0e7487aa0d1dffb4ed86"}}}}