{"action":"created","comment":{"url":"https://api.github.com/repos/fjordllc/interns/pulls/comments/42927972","id":42927972,"diff_hunk":"@@ -0,0 +1,102 @@\n+class ReportsController < ApplicationController\n+  before_action :require_login\n+  before_action :set_report, only: %w(show edit update destroy sort)\n+  before_action :set_user, only: :show\n+  before_action :set_user_updated, only: %w(show edit update)\n+  respond_to :html, :json\n+\n+  def index\n+    @reports = Report.order(updated_at: :desc)\n+    # @reports_edit = Report.order(updated_at: :desc)\n+    @user = User.find_by(id: params[:user_id])\n+    # @user_updated = User.find_by(id: params[:user_id_updated])\n+    # render :edit\n+  end\n+\n+  def show\n+    @reports = Report\n+    @user = User.find_by(id: params[:user_id])\n+    # @user_updated = User.find_by(id: params[:user_id_updated])\n+  end\n+\n+  def new\n+    @report = Report.new\n+    @report_flag = true\n+    @report_date = Date.today\n+    @user_name = current_user.login_name\n+  end\n+\n+  def edit\n+    @report.user = current_user\n+    # @report.user_updated = current_user\n+  end\n+\n+  def create\n+    @report = Report.new(report_params)\n+    @report.user = current_user\n+    # @report.user_updated = current_user\n+    # @report.update_column(\"user_id_updated = current_user.id\")\n+    if @report.save\n+      redirect_to @report,\n+        notice: t('report_was_successfully_created')\n+    else\n+      render :new\n+    end\n+    # @report = Report.new\n+\n+    # if @report.save\n+    #   notify \"<#{url_for(current_user)}|#{current_user.login_name}>が<#{url_for(@report)}|#{@report.title}>を作成しました。\"\n+    #   redirect_to @report, notice: t('report_was_successfully_created')\n+    # else\n+    #   render :new\n+    # end\n+  end\n+\n+  def update\n+    # @user_updated = current_user\n+    # @report.user = current_user\n+    # @user_updated = current_user\n+    if @report.update(report_params)\n+      redirect_to @report,\n+        notice: t('report_was_successfully_updated')\n+    else\n+      render :edit\n+    end\n+    # old_report = @report.dup\n+    # if @report.update(report_params)\n+    #   text = \"<#{url_for(current_user)}|#{current_user.login_name}>が<#{url_for(@report)}|#{@report.title}>を編集しました。\"\n+    #   notify text, pretext: text, title: \"差分\", value: Diffy::Diff.new(old_report.all_text + \"\\n\", @report.all_text + \"\\n\").to_s\n+    #   flash[:notice] = t('report_was_successfully_updated')\n+    # end\n+    # respond_with @report\n+  end\n+\n+  def destroy\n+    @report.destroy\n+    notify \"<#{url_for(current_user)}|#{current_user.login_name}>が<#{url_for(@report)}|#{@report.title}>を削除しました。\"\n+    redirect_to reports_url, notice: t('report_was_successfully_deleted')","path":"app/controllers/reports_controller.rb","position":77,"original_position":77,"commit_id":"110908330072f7bf3fc77d62e94df37f2ed728f5","original_commit_id":"110908330072f7bf3fc77d62e94df37f2ed728f5","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":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2015-10-24T01:21:04Z","updated_at":"2015-10-24T01:21:04Z","html_url":"https://github.com/fjordllc/interns/pull/88#discussion_r42927972","pull_request_url":"https://api.github.com/repos/fjordllc/interns/pulls/88","_links":{"self":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/comments/42927972"},"html":{"href":"https://github.com/fjordllc/interns/pull/88#discussion_r42927972"},"pull_request":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/fjordllc/interns/pulls/88","id":48645449,"html_url":"https://github.com/fjordllc/interns/pull/88","diff_url":"https://github.com/fjordllc/interns/pull/88.diff","patch_url":"https://github.com/fjordllc/interns/pull/88.patch","issue_url":"https://api.github.com/repos/fjordllc/interns/issues/88","number":88,"state":"open","locked":false,"title":"Add reports","user":{"login":"poyopoyo0","id":10114122,"avatar_url":"https://avatars.githubusercontent.com/u/10114122?v=3","gravatar_id":"","url":"https://api.github.com/users/poyopoyo0","html_url":"https://github.com/poyopoyo0","followers_url":"https://api.github.com/users/poyopoyo0/followers","following_url":"https://api.github.com/users/poyopoyo0/following{/other_user}","gists_url":"https://api.github.com/users/poyopoyo0/gists{/gist_id}","starred_url":"https://api.github.com/users/poyopoyo0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poyopoyo0/subscriptions","organizations_url":"https://api.github.com/users/poyopoyo0/orgs","repos_url":"https://api.github.com/users/poyopoyo0/repos","events_url":"https://api.github.com/users/poyopoyo0/events{/privacy}","received_events_url":"https://api.github.com/users/poyopoyo0/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-10-24T01:20:56Z","updated_at":"2015-10-24T01:21:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bb7c0144d5f94feb582001d46102a4e621549ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fjordllc/interns/pulls/88/commits","review_comments_url":"https://api.github.com/repos/fjordllc/interns/pulls/88/comments","review_comment_url":"https://api.github.com/repos/fjordllc/interns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fjordllc/interns/issues/88/comments","statuses_url":"https://api.github.com/repos/fjordllc/interns/statuses/110908330072f7bf3fc77d62e94df37f2ed728f5","head":{"label":"fjordllc:add-reports","ref":"add-reports","sha":"110908330072f7bf3fc77d62e94df37f2ed728f5","user":{"login":"fjordllc","id":1106666,"avatar_url":"https://avatars.githubusercontent.com/u/1106666?v=3","gravatar_id":"","url":"https://api.github.com/users/fjordllc","html_url":"https://github.com/fjordllc","followers_url":"https://api.github.com/users/fjordllc/followers","following_url":"https://api.github.com/users/fjordllc/following{/other_user}","gists_url":"https://api.github.com/users/fjordllc/gists{/gist_id}","starred_url":"https://api.github.com/users/fjordllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjordllc/subscriptions","organizations_url":"https://api.github.com/users/fjordllc/orgs","repos_url":"https://api.github.com/users/fjordllc/repos","events_url":"https://api.github.com/users/fjordllc/events{/privacy}","received_events_url":"https://api.github.com/users/fjordllc/received_events","type":"Organization","site_admin":false},"repo":{"id":5139175,"name":"interns","full_name":"fjordllc/interns","owner":{"login":"fjordllc","id":1106666,"avatar_url":"https://avatars.githubusercontent.com/u/1106666?v=3","gravatar_id":"","url":"https://api.github.com/users/fjordllc","html_url":"https://github.com/fjordllc","followers_url":"https://api.github.com/users/fjordllc/followers","following_url":"https://api.github.com/users/fjordllc/following{/other_user}","gists_url":"https://api.github.com/users/fjordllc/gists{/gist_id}","starred_url":"https://api.github.com/users/fjordllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjordllc/subscriptions","organizations_url":"https://api.github.com/users/fjordllc/orgs","repos_url":"https://api.github.com/users/fjordllc/repos","events_url":"https://api.github.com/users/fjordllc/events{/privacy}","received_events_url":"https://api.github.com/users/fjordllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fjordllc/interns","description":"Interns and E-Learning Management System.","fork":false,"url":"https://api.github.com/repos/fjordllc/interns","forks_url":"https://api.github.com/repos/fjordllc/interns/forks","keys_url":"https://api.github.com/repos/fjordllc/interns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fjordllc/interns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fjordllc/interns/teams","hooks_url":"https://api.github.com/repos/fjordllc/interns/hooks","issue_events_url":"https://api.github.com/repos/fjordllc/interns/issues/events{/number}","events_url":"https://api.github.com/repos/fjordllc/interns/events","assignees_url":"https://api.github.com/repos/fjordllc/interns/assignees{/user}","branches_url":"https://api.github.com/repos/fjordllc/interns/branches{/branch}","tags_url":"https://api.github.com/repos/fjordllc/interns/tags","blobs_url":"https://api.github.com/repos/fjordllc/interns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fjordllc/interns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fjordllc/interns/git/refs{/sha}","trees_url":"https://api.github.com/repos/fjordllc/interns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fjordllc/interns/statuses/{sha}","languages_url":"https://api.github.com/repos/fjordllc/interns/languages","stargazers_url":"https://api.github.com/repos/fjordllc/interns/stargazers","contributors_url":"https://api.github.com/repos/fjordllc/interns/contributors","subscribers_url":"https://api.github.com/repos/fjordllc/interns/subscribers","subscription_url":"https://api.github.com/repos/fjordllc/interns/subscription","commits_url":"https://api.github.com/repos/fjordllc/interns/commits{/sha}","git_commits_url":"https://api.github.com/repos/fjordllc/interns/git/commits{/sha}","comments_url":"https://api.github.com/repos/fjordllc/interns/comments{/number}","issue_comment_url":"https://api.github.com/repos/fjordllc/interns/issues/comments{/number}","contents_url":"https://api.github.com/repos/fjordllc/interns/contents/{+path}","compare_url":"https://api.github.com/repos/fjordllc/interns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fjordllc/interns/merges","archive_url":"https://api.github.com/repos/fjordllc/interns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fjordllc/interns/downloads","issues_url":"https://api.github.com/repos/fjordllc/interns/issues{/number}","pulls_url":"https://api.github.com/repos/fjordllc/interns/pulls{/number}","milestones_url":"https://api.github.com/repos/fjordllc/interns/milestones{/number}","notifications_url":"https://api.github.com/repos/fjordllc/interns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fjordllc/interns/labels{/name}","releases_url":"https://api.github.com/repos/fjordllc/interns/releases{/id}","created_at":"2012-07-22T04:59:57Z","updated_at":"2015-08-20T01:33:56Z","pushed_at":"2015-10-24T01:20:56Z","git_url":"git://github.com/fjordllc/interns.git","ssh_url":"git@github.com:fjordllc/interns.git","clone_url":"https://github.com/fjordllc/interns.git","svn_url":"https://github.com/fjordllc/interns","homepage":"","size":10497,"stargazers_count":30,"watchers_count":30,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":30,"default_branch":"master"}},"base":{"label":"fjordllc:master","ref":"master","sha":"d9c7e29afa3d40ce245d5f3ed29f54db60d94291","user":{"login":"fjordllc","id":1106666,"avatar_url":"https://avatars.githubusercontent.com/u/1106666?v=3","gravatar_id":"","url":"https://api.github.com/users/fjordllc","html_url":"https://github.com/fjordllc","followers_url":"https://api.github.com/users/fjordllc/followers","following_url":"https://api.github.com/users/fjordllc/following{/other_user}","gists_url":"https://api.github.com/users/fjordllc/gists{/gist_id}","starred_url":"https://api.github.com/users/fjordllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjordllc/subscriptions","organizations_url":"https://api.github.com/users/fjordllc/orgs","repos_url":"https://api.github.com/users/fjordllc/repos","events_url":"https://api.github.com/users/fjordllc/events{/privacy}","received_events_url":"https://api.github.com/users/fjordllc/received_events","type":"Organization","site_admin":false},"repo":{"id":5139175,"name":"interns","full_name":"fjordllc/interns","owner":{"login":"fjordllc","id":1106666,"avatar_url":"https://avatars.githubusercontent.com/u/1106666?v=3","gravatar_id":"","url":"https://api.github.com/users/fjordllc","html_url":"https://github.com/fjordllc","followers_url":"https://api.github.com/users/fjordllc/followers","following_url":"https://api.github.com/users/fjordllc/following{/other_user}","gists_url":"https://api.github.com/users/fjordllc/gists{/gist_id}","starred_url":"https://api.github.com/users/fjordllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjordllc/subscriptions","organizations_url":"https://api.github.com/users/fjordllc/orgs","repos_url":"https://api.github.com/users/fjordllc/repos","events_url":"https://api.github.com/users/fjordllc/events{/privacy}","received_events_url":"https://api.github.com/users/fjordllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fjordllc/interns","description":"Interns and E-Learning Management System.","fork":false,"url":"https://api.github.com/repos/fjordllc/interns","forks_url":"https://api.github.com/repos/fjordllc/interns/forks","keys_url":"https://api.github.com/repos/fjordllc/interns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fjordllc/interns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fjordllc/interns/teams","hooks_url":"https://api.github.com/repos/fjordllc/interns/hooks","issue_events_url":"https://api.github.com/repos/fjordllc/interns/issues/events{/number}","events_url":"https://api.github.com/repos/fjordllc/interns/events","assignees_url":"https://api.github.com/repos/fjordllc/interns/assignees{/user}","branches_url":"https://api.github.com/repos/fjordllc/interns/branches{/branch}","tags_url":"https://api.github.com/repos/fjordllc/interns/tags","blobs_url":"https://api.github.com/repos/fjordllc/interns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fjordllc/interns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fjordllc/interns/git/refs{/sha}","trees_url":"https://api.github.com/repos/fjordllc/interns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fjordllc/interns/statuses/{sha}","languages_url":"https://api.github.com/repos/fjordllc/interns/languages","stargazers_url":"https://api.github.com/repos/fjordllc/interns/stargazers","contributors_url":"https://api.github.com/repos/fjordllc/interns/contributors","subscribers_url":"https://api.github.com/repos/fjordllc/interns/subscribers","subscription_url":"https://api.github.com/repos/fjordllc/interns/subscription","commits_url":"https://api.github.com/repos/fjordllc/interns/commits{/sha}","git_commits_url":"https://api.github.com/repos/fjordllc/interns/git/commits{/sha}","comments_url":"https://api.github.com/repos/fjordllc/interns/comments{/number}","issue_comment_url":"https://api.github.com/repos/fjordllc/interns/issues/comments{/number}","contents_url":"https://api.github.com/repos/fjordllc/interns/contents/{+path}","compare_url":"https://api.github.com/repos/fjordllc/interns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fjordllc/interns/merges","archive_url":"https://api.github.com/repos/fjordllc/interns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fjordllc/interns/downloads","issues_url":"https://api.github.com/repos/fjordllc/interns/issues{/number}","pulls_url":"https://api.github.com/repos/fjordllc/interns/pulls{/number}","milestones_url":"https://api.github.com/repos/fjordllc/interns/milestones{/number}","notifications_url":"https://api.github.com/repos/fjordllc/interns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fjordllc/interns/labels{/name}","releases_url":"https://api.github.com/repos/fjordllc/interns/releases{/id}","created_at":"2012-07-22T04:59:57Z","updated_at":"2015-08-20T01:33:56Z","pushed_at":"2015-10-24T01:20:56Z","git_url":"git://github.com/fjordllc/interns.git","ssh_url":"git@github.com:fjordllc/interns.git","clone_url":"https://github.com/fjordllc/interns.git","svn_url":"https://github.com/fjordllc/interns","homepage":"","size":10497,"stargazers_count":30,"watchers_count":30,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/88"},"html":{"href":"https://github.com/fjordllc/interns/pull/88"},"issue":{"href":"https://api.github.com/repos/fjordllc/interns/issues/88"},"comments":{"href":"https://api.github.com/repos/fjordllc/interns/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fjordllc/interns/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/fjordllc/interns/statuses/110908330072f7bf3fc77d62e94df37f2ed728f5"}}}}