{"action":"created","comment":{"url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/comments/30422319","id":30422319,"diff_hunk":"@@ -1,87 +1,22 @@\n class ArticlesController < ApplicationController\n-  before_action :set_article, only: [:show, :edit, :update, :destroy]\n+  before_action :set_article, only: [:show]\n \n   # GET /articles\n-  # GET /articles.json\n   def index\n     @articles = Article.all\n   end\n \n   # GET /articles/1\n-  # GET /articles/1.json\n   def show\n     @attachments = @article.attachments\n   end\n \n-  # GET /articles/new\n-  def new\n-    @article = Article.new\n-  end\n-\n-  # GET /articles/1/edit\n-  def edit\n-  end\n-\n-  # POST /articles\n-  # POST /articles.json\n-  def create\n-    @article = Article.new(article_params)\n-\n-    respond_to do |format|\n-      if @article.save\n-        format.html { redirect_to @article, notice: 'Новая публикация успешно создана.' }\n-        format.json { render :show, status: :created, location: @article }\n-      else\n-        format.html { render :new }\n-        format.json { render json: @article.errors, status: :unprocessable_entity }\n-      end\n-    end\n-  end\n-\n-  # PATCH/PUT /articles/1\n-  # PATCH/PUT /articles/1.json\n-  def update\n-    respond_to do |format|\n-      if @article.update(article_params)\n-\n-        # save uploaded file\n-        uploaded_io = params[:article][:attachment]\n-        upload_name = uploaded_io.original_filename\n-        upload_filename = Digest::SHA1.hexdigest(Time.now.to_s + upload_name)\n-        upload_file_path = Rails.root.join('uploads', upload_filename)\n-        File.open(upload_file_path, 'wb') do |file|\n-          @attachment = Attachment.new(article_id: @article.id, name: upload_name, filename: upload_filename)\n-          @attachment.save\n-          file.write(uploaded_io.read)\n-        end\n-\n-        format.html { redirect_to @article, notice: 'Публикация обновлена.' }\n-        format.json { render :show, status: :ok, location: @article }\n-      else\n-        format.html { render :edit }\n-        format.json { render json: @article.errors, status: :unprocessable_entity }\n-      end\n-    end\n-  end\n-\n-  # DELETE /articles/1\n-  # DELETE /articles/1.json\n-  def destroy\n-    @article.destroy\n-    respond_to do |format|\n-      format.html { redirect_to articles_url, notice: 'Публикация удалена.' }\n-      format.json { head :no_content }\n-    end\n-  end\n-\n   private\n     # Use callbacks to share common setup or constraints between actions.\n     def set_article\n       @article = Article.find(params[:id])\n+      rescue ActiveRecord::RecordNotFound\n+      redirect_to articles_path, alert: 'Статья не найден'","path":"app/controllers/articles_controller.rb","position":83,"original_position":83,"commit_id":"47fb28d8be6fccf864c19f3d4fbf39a4226d448c","original_commit_id":"47fb28d8be6fccf864c19f3d4fbf39a4226d448c","user":{"login":"akurashev","id":3483511,"avatar_url":"https://avatars.githubusercontent.com/u/3483511?v=3","gravatar_id":"","url":"https://api.github.com/users/akurashev","html_url":"https://github.com/akurashev","followers_url":"https://api.github.com/users/akurashev/followers","following_url":"https://api.github.com/users/akurashev/following{/other_user}","gists_url":"https://api.github.com/users/akurashev/gists{/gist_id}","starred_url":"https://api.github.com/users/akurashev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akurashev/subscriptions","organizations_url":"https://api.github.com/users/akurashev/orgs","repos_url":"https://api.github.com/users/akurashev/repos","events_url":"https://api.github.com/users/akurashev/events{/privacy}","received_events_url":"https://api.github.com/users/akurashev/received_events","type":"User","site_admin":false},"body":"здесь то же самое про отступы `rescue` и про опечатку в алерте","created_at":"2015-05-15T16:15:06Z","updated_at":"2015-05-15T16:15:06Z","html_url":"https://github.com/Zlodimir/uniblog/pull/9#discussion_r30422319","pull_request_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/comments/30422319"},"html":{"href":"https://github.com/Zlodimir/uniblog/pull/9#discussion_r30422319"},"pull_request":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9","id":34685467,"html_url":"https://github.com/Zlodimir/uniblog/pull/9","diff_url":"https://github.com/Zlodimir/uniblog/pull/9.diff","patch_url":"https://github.com/Zlodimir/uniblog/pull/9.patch","issue_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/9","number":9,"state":"open","locked":false,"title":"Articles attachments","user":{"login":"ValentinZakharov","id":7569471,"avatar_url":"https://avatars.githubusercontent.com/u/7569471?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinZakharov","html_url":"https://github.com/ValentinZakharov","followers_url":"https://api.github.com/users/ValentinZakharov/followers","following_url":"https://api.github.com/users/ValentinZakharov/following{/other_user}","gists_url":"https://api.github.com/users/ValentinZakharov/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinZakharov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinZakharov/subscriptions","organizations_url":"https://api.github.com/users/ValentinZakharov/orgs","repos_url":"https://api.github.com/users/ValentinZakharov/repos","events_url":"https://api.github.com/users/ValentinZakharov/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinZakharov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-04T23:31:03Z","updated_at":"2015-05-15T16:15:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef946b8e42a2d922c001c26993d72c10c1877114","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/9/comments","statuses_url":"https://api.github.com/repos/Zlodimir/uniblog/statuses/47fb28d8be6fccf864c19f3d4fbf39a4226d448c","head":{"label":"Zlodimir:articles_attachments","ref":"articles_attachments","sha":"47fb28d8be6fccf864c19f3d4fbf39a4226d448c","user":{"login":"Zlodimir","id":1927695,"avatar_url":"https://avatars.githubusercontent.com/u/1927695?v=3","gravatar_id":"","url":"https://api.github.com/users/Zlodimir","html_url":"https://github.com/Zlodimir","followers_url":"https://api.github.com/users/Zlodimir/followers","following_url":"https://api.github.com/users/Zlodimir/following{/other_user}","gists_url":"https://api.github.com/users/Zlodimir/gists{/gist_id}","starred_url":"https://api.github.com/users/Zlodimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zlodimir/subscriptions","organizations_url":"https://api.github.com/users/Zlodimir/orgs","repos_url":"https://api.github.com/users/Zlodimir/repos","events_url":"https://api.github.com/users/Zlodimir/events{/privacy}","received_events_url":"https://api.github.com/users/Zlodimir/received_events","type":"User","site_admin":false},"repo":{"id":33815186,"name":"uniblog","full_name":"Zlodimir/uniblog","owner":{"login":"Zlodimir","id":1927695,"avatar_url":"https://avatars.githubusercontent.com/u/1927695?v=3","gravatar_id":"","url":"https://api.github.com/users/Zlodimir","html_url":"https://github.com/Zlodimir","followers_url":"https://api.github.com/users/Zlodimir/followers","following_url":"https://api.github.com/users/Zlodimir/following{/other_user}","gists_url":"https://api.github.com/users/Zlodimir/gists{/gist_id}","starred_url":"https://api.github.com/users/Zlodimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zlodimir/subscriptions","organizations_url":"https://api.github.com/users/Zlodimir/orgs","repos_url":"https://api.github.com/users/Zlodimir/repos","events_url":"https://api.github.com/users/Zlodimir/events{/privacy}","received_events_url":"https://api.github.com/users/Zlodimir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zlodimir/uniblog","description":"Universal Blog","fork":false,"url":"https://api.github.com/repos/Zlodimir/uniblog","forks_url":"https://api.github.com/repos/Zlodimir/uniblog/forks","keys_url":"https://api.github.com/repos/Zlodimir/uniblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zlodimir/uniblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zlodimir/uniblog/teams","hooks_url":"https://api.github.com/repos/Zlodimir/uniblog/hooks","issue_events_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/events{/number}","events_url":"https://api.github.com/repos/Zlodimir/uniblog/events","assignees_url":"https://api.github.com/repos/Zlodimir/uniblog/assignees{/user}","branches_url":"https://api.github.com/repos/Zlodimir/uniblog/branches{/branch}","tags_url":"https://api.github.com/repos/Zlodimir/uniblog/tags","blobs_url":"https://api.github.com/repos/Zlodimir/uniblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zlodimir/uniblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zlodimir/uniblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zlodimir/uniblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zlodimir/uniblog/statuses/{sha}","languages_url":"https://api.github.com/repos/Zlodimir/uniblog/languages","stargazers_url":"https://api.github.com/repos/Zlodimir/uniblog/stargazers","contributors_url":"https://api.github.com/repos/Zlodimir/uniblog/contributors","subscribers_url":"https://api.github.com/repos/Zlodimir/uniblog/subscribers","subscription_url":"https://api.github.com/repos/Zlodimir/uniblog/subscription","commits_url":"https://api.github.com/repos/Zlodimir/uniblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zlodimir/uniblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zlodimir/uniblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zlodimir/uniblog/contents/{+path}","compare_url":"https://api.github.com/repos/Zlodimir/uniblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zlodimir/uniblog/merges","archive_url":"https://api.github.com/repos/Zlodimir/uniblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zlodimir/uniblog/downloads","issues_url":"https://api.github.com/repos/Zlodimir/uniblog/issues{/number}","pulls_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls{/number}","milestones_url":"https://api.github.com/repos/Zlodimir/uniblog/milestones{/number}","notifications_url":"https://api.github.com/repos/Zlodimir/uniblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zlodimir/uniblog/labels{/name}","releases_url":"https://api.github.com/repos/Zlodimir/uniblog/releases{/id}","created_at":"2015-04-12T12:00:44Z","updated_at":"2015-04-29T08:53:40Z","pushed_at":"2015-05-14T17:32:46Z","git_url":"git://github.com/Zlodimir/uniblog.git","ssh_url":"git@github.com:Zlodimir/uniblog.git","clone_url":"https://github.com/Zlodimir/uniblog.git","svn_url":"https://github.com/Zlodimir/uniblog","homepage":null,"size":1244,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Zlodimir:master","ref":"master","sha":"ecdcde1460d0792b9fb38f6ab781c9e2e73443c5","user":{"login":"Zlodimir","id":1927695,"avatar_url":"https://avatars.githubusercontent.com/u/1927695?v=3","gravatar_id":"","url":"https://api.github.com/users/Zlodimir","html_url":"https://github.com/Zlodimir","followers_url":"https://api.github.com/users/Zlodimir/followers","following_url":"https://api.github.com/users/Zlodimir/following{/other_user}","gists_url":"https://api.github.com/users/Zlodimir/gists{/gist_id}","starred_url":"https://api.github.com/users/Zlodimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zlodimir/subscriptions","organizations_url":"https://api.github.com/users/Zlodimir/orgs","repos_url":"https://api.github.com/users/Zlodimir/repos","events_url":"https://api.github.com/users/Zlodimir/events{/privacy}","received_events_url":"https://api.github.com/users/Zlodimir/received_events","type":"User","site_admin":false},"repo":{"id":33815186,"name":"uniblog","full_name":"Zlodimir/uniblog","owner":{"login":"Zlodimir","id":1927695,"avatar_url":"https://avatars.githubusercontent.com/u/1927695?v=3","gravatar_id":"","url":"https://api.github.com/users/Zlodimir","html_url":"https://github.com/Zlodimir","followers_url":"https://api.github.com/users/Zlodimir/followers","following_url":"https://api.github.com/users/Zlodimir/following{/other_user}","gists_url":"https://api.github.com/users/Zlodimir/gists{/gist_id}","starred_url":"https://api.github.com/users/Zlodimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zlodimir/subscriptions","organizations_url":"https://api.github.com/users/Zlodimir/orgs","repos_url":"https://api.github.com/users/Zlodimir/repos","events_url":"https://api.github.com/users/Zlodimir/events{/privacy}","received_events_url":"https://api.github.com/users/Zlodimir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zlodimir/uniblog","description":"Universal Blog","fork":false,"url":"https://api.github.com/repos/Zlodimir/uniblog","forks_url":"https://api.github.com/repos/Zlodimir/uniblog/forks","keys_url":"https://api.github.com/repos/Zlodimir/uniblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zlodimir/uniblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zlodimir/uniblog/teams","hooks_url":"https://api.github.com/repos/Zlodimir/uniblog/hooks","issue_events_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/events{/number}","events_url":"https://api.github.com/repos/Zlodimir/uniblog/events","assignees_url":"https://api.github.com/repos/Zlodimir/uniblog/assignees{/user}","branches_url":"https://api.github.com/repos/Zlodimir/uniblog/branches{/branch}","tags_url":"https://api.github.com/repos/Zlodimir/uniblog/tags","blobs_url":"https://api.github.com/repos/Zlodimir/uniblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zlodimir/uniblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zlodimir/uniblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zlodimir/uniblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zlodimir/uniblog/statuses/{sha}","languages_url":"https://api.github.com/repos/Zlodimir/uniblog/languages","stargazers_url":"https://api.github.com/repos/Zlodimir/uniblog/stargazers","contributors_url":"https://api.github.com/repos/Zlodimir/uniblog/contributors","subscribers_url":"https://api.github.com/repos/Zlodimir/uniblog/subscribers","subscription_url":"https://api.github.com/repos/Zlodimir/uniblog/subscription","commits_url":"https://api.github.com/repos/Zlodimir/uniblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zlodimir/uniblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zlodimir/uniblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zlodimir/uniblog/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zlodimir/uniblog/contents/{+path}","compare_url":"https://api.github.com/repos/Zlodimir/uniblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zlodimir/uniblog/merges","archive_url":"https://api.github.com/repos/Zlodimir/uniblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zlodimir/uniblog/downloads","issues_url":"https://api.github.com/repos/Zlodimir/uniblog/issues{/number}","pulls_url":"https://api.github.com/repos/Zlodimir/uniblog/pulls{/number}","milestones_url":"https://api.github.com/repos/Zlodimir/uniblog/milestones{/number}","notifications_url":"https://api.github.com/repos/Zlodimir/uniblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zlodimir/uniblog/labels{/name}","releases_url":"https://api.github.com/repos/Zlodimir/uniblog/releases{/id}","created_at":"2015-04-12T12:00:44Z","updated_at":"2015-04-29T08:53:40Z","pushed_at":"2015-05-14T17:32:46Z","git_url":"git://github.com/Zlodimir/uniblog.git","ssh_url":"git@github.com:Zlodimir/uniblog.git","clone_url":"https://github.com/Zlodimir/uniblog.git","svn_url":"https://github.com/Zlodimir/uniblog","homepage":null,"size":1244,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9"},"html":{"href":"https://github.com/Zlodimir/uniblog/pull/9"},"issue":{"href":"https://api.github.com/repos/Zlodimir/uniblog/issues/9"},"comments":{"href":"https://api.github.com/repos/Zlodimir/uniblog/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Zlodimir/uniblog/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Zlodimir/uniblog/statuses/47fb28d8be6fccf864c19f3d4fbf39a4226d448c"}}}}