{"action":"created","comment":{"url":"https://api.github.com/repos/catarse/catarse/pulls/comments/33111717","id":33111717,"diff_hunk":"@@ -0,0 +1,83 @@\n+class BankAccountsController < ApplicationController\n+  after_action :verify_authorized\n+  helper_method :resource, :user_decorator\n+  respond_to :html\n+  before_filter :need_pending_refunds, except: [:show]\n+\n+  def new\n+    authorize resource\n+    if !resource.new_record?\n+      redirect_to edit_bank_account_path(resource)\n+    else\n+      render :edit\n+    end\n+  end\n+\n+  def edit\n+    authorize resource\n+  end\n+\n+  def show\n+    authorize resource\n+  end\n+\n+  def confirm\n+    authorize resource\n+  end\n+\n+  def create\n+    authorize resource\n+    resource.update_attributes(permitted_params)\n+\n+    if resource.save\n+      redirect_to confirm_bank_account_path(resource)\n+    else\n+      render :edit\n+    end\n+  end\n+\n+  def update\n+    authorize resource\n+    resource.update_attributes(permitted_params)\n+    respond_with(resource, location: confirm_bank_account_path(resource))\n+  end\n+\n+  def request_refund\n+    authorize resource\n+    session[:pending_refund_payments_amount] = user_decorator.display_pending_refund_payments_amount\n+\n+    user.pending_refund_payments.each do |payment|\n+      payment.direct_refund\n+    end\n+\n+    redirect_to bank_account_path(resource)\n+  end\n+\n+  def resource\n+    @bank_account ||= find_bank_account\n+  end\n+\n+  def user_decorator\n+    user.decorator\n+  end\n+\n+  protected\n+\n+  def user\n+    @user ||= resource.user\n+  end\n+\n+  def need_pending_refunds","path":"app/controllers/bank_accounts_controller.rb","position":70,"original_position":70,"commit_id":"49199c723c5dc7d097e665429e18cf9f15059f16","original_commit_id":"49199c723c5dc7d097e665429e18cf9f15059f16","user":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"body":"This will crash if the user is not logged in.","created_at":"2015-06-24T01:58:33Z","updated_at":"2015-06-24T01:58:33Z","html_url":"https://github.com/catarse/catarse/pull/1535#discussion_r33111717","pull_request_url":"https://api.github.com/repos/catarse/catarse/pulls/1535","_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse/pulls/comments/33111717"},"html":{"href":"https://github.com/catarse/catarse/pull/1535#discussion_r33111717"},"pull_request":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1535"}}},"pull_request":{"url":"https://api.github.com/repos/catarse/catarse/pulls/1535","id":38249679,"html_url":"https://github.com/catarse/catarse/pull/1535","diff_url":"https://github.com/catarse/catarse/pull/1535.diff","patch_url":"https://github.com/catarse/catarse/pull/1535.patch","issue_url":"https://api.github.com/repos/catarse/catarse/issues/1535","number":1535,"state":"open","locked":false,"title":"New flow to request refund for paid payments on failed projects","user":{"login":"devton","id":154595,"avatar_url":"https://avatars.githubusercontent.com/u/154595?v=3","gravatar_id":"","url":"https://api.github.com/users/devton","html_url":"https://github.com/devton","followers_url":"https://api.github.com/users/devton/followers","following_url":"https://api.github.com/users/devton/following{/other_user}","gists_url":"https://api.github.com/users/devton/gists{/gist_id}","starred_url":"https://api.github.com/users/devton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devton/subscriptions","organizations_url":"https://api.github.com/users/devton/orgs","repos_url":"https://api.github.com/users/devton/repos","events_url":"https://api.github.com/users/devton/events{/privacy}","received_events_url":"https://api.github.com/users/devton/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-22T16:24:03Z","updated_at":"2015-06-24T01:58:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2444285a950e4ce64fcdffc40fbb9c6cd71b33f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/catarse/catarse/pulls/1535/commits","review_comments_url":"https://api.github.com/repos/catarse/catarse/pulls/1535/comments","review_comment_url":"https://api.github.com/repos/catarse/catarse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/catarse/catarse/issues/1535/comments","statuses_url":"https://api.github.com/repos/catarse/catarse/statuses/49199c723c5dc7d097e665429e18cf9f15059f16","head":{"label":"catarse:pending_refunds_actions","ref":"pending_refunds_actions","sha":"49199c723c5dc7d097e665429e18cf9f15059f16","user":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"repo":{"id":1071489,"name":"catarse","full_name":"catarse/catarse","owner":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/catarse/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":false,"url":"https://api.github.com/repos/catarse/catarse","forks_url":"https://api.github.com/repos/catarse/catarse/forks","keys_url":"https://api.github.com/repos/catarse/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catarse/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catarse/catarse/teams","hooks_url":"https://api.github.com/repos/catarse/catarse/hooks","issue_events_url":"https://api.github.com/repos/catarse/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/catarse/catarse/events","assignees_url":"https://api.github.com/repos/catarse/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/catarse/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/catarse/catarse/tags","blobs_url":"https://api.github.com/repos/catarse/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catarse/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catarse/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/catarse/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catarse/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/catarse/catarse/languages","stargazers_url":"https://api.github.com/repos/catarse/catarse/stargazers","contributors_url":"https://api.github.com/repos/catarse/catarse/contributors","subscribers_url":"https://api.github.com/repos/catarse/catarse/subscribers","subscription_url":"https://api.github.com/repos/catarse/catarse/subscription","commits_url":"https://api.github.com/repos/catarse/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/catarse/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/catarse/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/catarse/catarse/issues/comments{/number}","contents_url":"https://api.github.com/repos/catarse/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/catarse/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catarse/catarse/merges","archive_url":"https://api.github.com/repos/catarse/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catarse/catarse/downloads","issues_url":"https://api.github.com/repos/catarse/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/catarse/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/catarse/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/catarse/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catarse/catarse/labels{/name}","releases_url":"https://api.github.com/repos/catarse/catarse/releases{/id}","created_at":"2010-11-11T13:37:03Z","updated_at":"2015-06-22T12:50:25Z","pushed_at":"2015-06-24T00:53:03Z","git_url":"git://github.com/catarse/catarse.git","ssh_url":"git@github.com:catarse/catarse.git","clone_url":"https://github.com/catarse/catarse.git","svn_url":"https://github.com/catarse/catarse","homepage":"http://catarse.me","size":110470,"stargazers_count":827,"watchers_count":827,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":577,"mirror_url":null,"open_issues_count":11,"forks":577,"open_issues":11,"watchers":827,"default_branch":"master"}},"base":{"label":"catarse:master","ref":"master","sha":"86a517611a23976e1d475810c8c33084b27fee0d","user":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"repo":{"id":1071489,"name":"catarse","full_name":"catarse/catarse","owner":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/catarse/catarse","description":"The first open source crowdfunding platform for creative projects in the world","fork":false,"url":"https://api.github.com/repos/catarse/catarse","forks_url":"https://api.github.com/repos/catarse/catarse/forks","keys_url":"https://api.github.com/repos/catarse/catarse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catarse/catarse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catarse/catarse/teams","hooks_url":"https://api.github.com/repos/catarse/catarse/hooks","issue_events_url":"https://api.github.com/repos/catarse/catarse/issues/events{/number}","events_url":"https://api.github.com/repos/catarse/catarse/events","assignees_url":"https://api.github.com/repos/catarse/catarse/assignees{/user}","branches_url":"https://api.github.com/repos/catarse/catarse/branches{/branch}","tags_url":"https://api.github.com/repos/catarse/catarse/tags","blobs_url":"https://api.github.com/repos/catarse/catarse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catarse/catarse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catarse/catarse/git/refs{/sha}","trees_url":"https://api.github.com/repos/catarse/catarse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catarse/catarse/statuses/{sha}","languages_url":"https://api.github.com/repos/catarse/catarse/languages","stargazers_url":"https://api.github.com/repos/catarse/catarse/stargazers","contributors_url":"https://api.github.com/repos/catarse/catarse/contributors","subscribers_url":"https://api.github.com/repos/catarse/catarse/subscribers","subscription_url":"https://api.github.com/repos/catarse/catarse/subscription","commits_url":"https://api.github.com/repos/catarse/catarse/commits{/sha}","git_commits_url":"https://api.github.com/repos/catarse/catarse/git/commits{/sha}","comments_url":"https://api.github.com/repos/catarse/catarse/comments{/number}","issue_comment_url":"https://api.github.com/repos/catarse/catarse/issues/comments{/number}","contents_url":"https://api.github.com/repos/catarse/catarse/contents/{+path}","compare_url":"https://api.github.com/repos/catarse/catarse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catarse/catarse/merges","archive_url":"https://api.github.com/repos/catarse/catarse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catarse/catarse/downloads","issues_url":"https://api.github.com/repos/catarse/catarse/issues{/number}","pulls_url":"https://api.github.com/repos/catarse/catarse/pulls{/number}","milestones_url":"https://api.github.com/repos/catarse/catarse/milestones{/number}","notifications_url":"https://api.github.com/repos/catarse/catarse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catarse/catarse/labels{/name}","releases_url":"https://api.github.com/repos/catarse/catarse/releases{/id}","created_at":"2010-11-11T13:37:03Z","updated_at":"2015-06-22T12:50:25Z","pushed_at":"2015-06-24T00:53:03Z","git_url":"git://github.com/catarse/catarse.git","ssh_url":"git@github.com:catarse/catarse.git","clone_url":"https://github.com/catarse/catarse.git","svn_url":"https://github.com/catarse/catarse","homepage":"http://catarse.me","size":110470,"stargazers_count":827,"watchers_count":827,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":577,"mirror_url":null,"open_issues_count":11,"forks":577,"open_issues":11,"watchers":827,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1535"},"html":{"href":"https://github.com/catarse/catarse/pull/1535"},"issue":{"href":"https://api.github.com/repos/catarse/catarse/issues/1535"},"comments":{"href":"https://api.github.com/repos/catarse/catarse/issues/1535/comments"},"review_comments":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1535/comments"},"review_comment":{"href":"https://api.github.com/repos/catarse/catarse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/catarse/catarse/pulls/1535/commits"},"statuses":{"href":"https://api.github.com/repos/catarse/catarse/statuses/49199c723c5dc7d097e665429e18cf9f15059f16"}}}}