{"action":"created","comment":{"url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/comments/31168015","id":31168015,"diff_hunk":"@@ -0,0 +1,52 @@\n+class ArticlesController < ApplicationController\n+  before_action :set_article, :only => [:edit, :update, :destroy, :show]\n+  skip_before_action :require_login, only: [:show, :index]\n+  def index\n+    @articles = Article.includes(:user)\n+  end\n+\n+  def new\n+    @article = Article.new\n+  end\n+\n+  def show\n+  end\n+\n+  def edit\n+  end\n+\n+  def create\n+    @article = current_user.articles.new(article_params)\n+    if @article.save\n+      redirect_to @article, notice: \"Статья была успешно создана\"\n+    else\n+      render \"edit\"\n+    end\n+  end\n+\n+  def update\n+    authorize @article\n+    if @article.update(article_params)\n+      redirect_to @article, notice: \"Статья была успешно обновлена\"\n+    else\n+      render 'edit'\n+    end\n+  end\n+\n+  def destroy\n+    authorize @article\n+    @article.destroy\n+    redirect_to articles_url, notice: \"Статья была успешно удалена\"\n+  end\n+\n+  private\n+\n+  def article_params\n+    params.require(:article).permit(:title, :content)\n+  end\n+\n+  def set_article\n+    @article = Article.find(params[:id])\n+  end\n+","path":"app/controllers/articles_controller.rb","position":51,"original_position":51,"commit_id":"e696a64143361e15a5d7b239dd13e5170f15b657","original_commit_id":"e696a64143361e15a5d7b239dd13e5170f15b657","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":"Extra empty line detected at class body end.","created_at":"2015-05-27T18:57:35Z","updated_at":"2015-05-27T18:57:35Z","html_url":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7#discussion_r31168015","pull_request_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/comments/31168015"},"html":{"href":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7#discussion_r31168015"},"pull_request":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7","id":36332120,"html_url":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7","diff_url":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7.diff","patch_url":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7.patch","issue_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/7","number":7,"state":"open","locked":false,"title":"Add article","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-27T18:11:04Z","updated_at":"2015-05-27T18:57:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f2f9ccb6631c104e96288f089bd9572b8247603","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7/commits","review_comments_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7/comments","review_comment_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/7/comments","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/statuses/e696a64143361e15a5d7b239dd13e5170f15b657","head":{"label":"DemidenkoAndrey:add-article","ref":"add-article","sha":"e696a64143361e15a5d7b239dd13e5170f15b657","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"repo":{"id":34814609,"name":"HousingOperationalService","full_name":"DemidenkoAndrey/HousingOperationalService","owner":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DemidenkoAndrey/HousingOperationalService","description":"Graduation Work","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService","forks_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/releases{/id}","created_at":"2015-04-29T19:44:54Z","updated_at":"2015-05-04T21:01:01Z","pushed_at":"2015-05-27T18:57:31Z","git_url":"git://github.com/DemidenkoAndrey/HousingOperationalService.git","ssh_url":"git@github.com:DemidenkoAndrey/HousingOperationalService.git","clone_url":"https://github.com/DemidenkoAndrey/HousingOperationalService.git","svn_url":"https://github.com/DemidenkoAndrey/HousingOperationalService","homepage":null,"size":844,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"DemidenkoAndrey:master","ref":"master","sha":"786c5486347ecf48278b733209f2c64a28f35616","user":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"repo":{"id":34814609,"name":"HousingOperationalService","full_name":"DemidenkoAndrey/HousingOperationalService","owner":{"login":"DemidenkoAndrey","id":8194192,"avatar_url":"https://avatars.githubusercontent.com/u/8194192?v=3","gravatar_id":"","url":"https://api.github.com/users/DemidenkoAndrey","html_url":"https://github.com/DemidenkoAndrey","followers_url":"https://api.github.com/users/DemidenkoAndrey/followers","following_url":"https://api.github.com/users/DemidenkoAndrey/following{/other_user}","gists_url":"https://api.github.com/users/DemidenkoAndrey/gists{/gist_id}","starred_url":"https://api.github.com/users/DemidenkoAndrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DemidenkoAndrey/subscriptions","organizations_url":"https://api.github.com/users/DemidenkoAndrey/orgs","repos_url":"https://api.github.com/users/DemidenkoAndrey/repos","events_url":"https://api.github.com/users/DemidenkoAndrey/events{/privacy}","received_events_url":"https://api.github.com/users/DemidenkoAndrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DemidenkoAndrey/HousingOperationalService","description":"Graduation Work","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService","forks_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/releases{/id}","created_at":"2015-04-29T19:44:54Z","updated_at":"2015-05-04T21:01:01Z","pushed_at":"2015-05-27T18:57:31Z","git_url":"git://github.com/DemidenkoAndrey/HousingOperationalService.git","ssh_url":"git@github.com:DemidenkoAndrey/HousingOperationalService.git","clone_url":"https://github.com/DemidenkoAndrey/HousingOperationalService.git","svn_url":"https://github.com/DemidenkoAndrey/HousingOperationalService","homepage":null,"size":844,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7"},"html":{"href":"https://github.com/DemidenkoAndrey/HousingOperationalService/pull/7"},"issue":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/7"},"comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/DemidenkoAndrey/HousingOperationalService/statuses/e696a64143361e15a5d7b239dd13e5170f15b657"}}}}