{"action":"created","comment":{"url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/comments/59860827","id":59860827,"diff_hunk":"@@ -1,6 +1,10 @@\n class Question < ActiveRecord::Base\n-  belongs_to :user  \n+  belongs_to :user \n   has_many   :answers, dependent: :destroy\n   \n   validates  :title, :body, :user_id, presence: true\n+\n+  def best_answer\n+    self.answers.first","path":"app/models/question.rb","position":9,"original_position":9,"commit_id":"17ca826814cc4c71c58ecb34c1161768366ae65e","original_commit_id":"17ca826814cc4c71c58ecb34c1161768366ae65e","user":{"login":"vkurennov","id":968537,"avatar_url":"https://avatars.githubusercontent.com/u/968537?v=3","gravatar_id":"","url":"https://api.github.com/users/vkurennov","html_url":"https://github.com/vkurennov","followers_url":"https://api.github.com/users/vkurennov/followers","following_url":"https://api.github.com/users/vkurennov/following{/other_user}","gists_url":"https://api.github.com/users/vkurennov/gists{/gist_id}","starred_url":"https://api.github.com/users/vkurennov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkurennov/subscriptions","organizations_url":"https://api.github.com/users/vkurennov/orgs","repos_url":"https://api.github.com/users/vkurennov/repos","events_url":"https://api.github.com/users/vkurennov/events{/privacy}","received_events_url":"https://api.github.com/users/vkurennov/received_events","type":"User","site_admin":false},"body":"Не верно, тут нужно найти именно тот ответ, у которого флаг best установлен в true. Вдруг сортировка поменяется, тогда метод будет работать не верно.","created_at":"2016-04-15T11:25:49Z","updated_at":"2016-04-15T11:25:49Z","html_url":"https://github.com/nmiloserdov/queue-flow/pull/6#discussion_r59860827","pull_request_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/comments/59860827"},"html":{"href":"https://github.com/nmiloserdov/queue-flow/pull/6#discussion_r59860827"},"pull_request":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6","id":65922654,"html_url":"https://github.com/nmiloserdov/queue-flow/pull/6","diff_url":"https://github.com/nmiloserdov/queue-flow/pull/6.diff","patch_url":"https://github.com/nmiloserdov/queue-flow/pull/6.patch","issue_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/6","number":6,"state":"open","locked":false,"title":"Feature ajax - 2","user":{"login":"nmiloserdov","id":14846508,"avatar_url":"https://avatars.githubusercontent.com/u/14846508?v=3","gravatar_id":"","url":"https://api.github.com/users/nmiloserdov","html_url":"https://github.com/nmiloserdov","followers_url":"https://api.github.com/users/nmiloserdov/followers","following_url":"https://api.github.com/users/nmiloserdov/following{/other_user}","gists_url":"https://api.github.com/users/nmiloserdov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmiloserdov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmiloserdov/subscriptions","organizations_url":"https://api.github.com/users/nmiloserdov/orgs","repos_url":"https://api.github.com/users/nmiloserdov/repos","events_url":"https://api.github.com/users/nmiloserdov/events{/privacy}","received_events_url":"https://api.github.com/users/nmiloserdov/received_events","type":"User","site_admin":false},"body":"У меня вопрос как избежать, такое адское повторение js?\r\nПри создании ответа на вопрос, у созданного ответа нету хэндлера с описанными методами на удаление/редактирвоание, как с этим бороться, перезагружать js?\r\n","created_at":"2016-04-10T20:57:23Z","updated_at":"2016-04-15T11:25:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"141240450b06f9934204cf26a988af0744dbfb98","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6/commits","review_comments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6/comments","review_comment_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/6/comments","statuses_url":"https://api.github.com/repos/nmiloserdov/queue-flow/statuses/17ca826814cc4c71c58ecb34c1161768366ae65e","head":{"label":"nmiloserdov:feature-ajax","ref":"feature-ajax","sha":"17ca826814cc4c71c58ecb34c1161768366ae65e","user":{"login":"nmiloserdov","id":14846508,"avatar_url":"https://avatars.githubusercontent.com/u/14846508?v=3","gravatar_id":"","url":"https://api.github.com/users/nmiloserdov","html_url":"https://github.com/nmiloserdov","followers_url":"https://api.github.com/users/nmiloserdov/followers","following_url":"https://api.github.com/users/nmiloserdov/following{/other_user}","gists_url":"https://api.github.com/users/nmiloserdov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmiloserdov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmiloserdov/subscriptions","organizations_url":"https://api.github.com/users/nmiloserdov/orgs","repos_url":"https://api.github.com/users/nmiloserdov/repos","events_url":"https://api.github.com/users/nmiloserdov/events{/privacy}","received_events_url":"https://api.github.com/users/nmiloserdov/received_events","type":"User","site_admin":false},"repo":{"id":53793006,"name":"queue-flow","full_name":"nmiloserdov/queue-flow","owner":{"login":"nmiloserdov","id":14846508,"avatar_url":"https://avatars.githubusercontent.com/u/14846508?v=3","gravatar_id":"","url":"https://api.github.com/users/nmiloserdov","html_url":"https://github.com/nmiloserdov","followers_url":"https://api.github.com/users/nmiloserdov/followers","following_url":"https://api.github.com/users/nmiloserdov/following{/other_user}","gists_url":"https://api.github.com/users/nmiloserdov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmiloserdov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmiloserdov/subscriptions","organizations_url":"https://api.github.com/users/nmiloserdov/orgs","repos_url":"https://api.github.com/users/nmiloserdov/repos","events_url":"https://api.github.com/users/nmiloserdov/events{/privacy}","received_events_url":"https://api.github.com/users/nmiloserdov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmiloserdov/queue-flow","description":"Stack Overflow clone","fork":false,"url":"https://api.github.com/repos/nmiloserdov/queue-flow","forks_url":"https://api.github.com/repos/nmiloserdov/queue-flow/forks","keys_url":"https://api.github.com/repos/nmiloserdov/queue-flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmiloserdov/queue-flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmiloserdov/queue-flow/teams","hooks_url":"https://api.github.com/repos/nmiloserdov/queue-flow/hooks","issue_events_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/events{/number}","events_url":"https://api.github.com/repos/nmiloserdov/queue-flow/events","assignees_url":"https://api.github.com/repos/nmiloserdov/queue-flow/assignees{/user}","branches_url":"https://api.github.com/repos/nmiloserdov/queue-flow/branches{/branch}","tags_url":"https://api.github.com/repos/nmiloserdov/queue-flow/tags","blobs_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmiloserdov/queue-flow/statuses/{sha}","languages_url":"https://api.github.com/repos/nmiloserdov/queue-flow/languages","stargazers_url":"https://api.github.com/repos/nmiloserdov/queue-flow/stargazers","contributors_url":"https://api.github.com/repos/nmiloserdov/queue-flow/contributors","subscribers_url":"https://api.github.com/repos/nmiloserdov/queue-flow/subscribers","subscription_url":"https://api.github.com/repos/nmiloserdov/queue-flow/subscription","commits_url":"https://api.github.com/repos/nmiloserdov/queue-flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmiloserdov/queue-flow/contents/{+path}","compare_url":"https://api.github.com/repos/nmiloserdov/queue-flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmiloserdov/queue-flow/merges","archive_url":"https://api.github.com/repos/nmiloserdov/queue-flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmiloserdov/queue-flow/downloads","issues_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues{/number}","pulls_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls{/number}","milestones_url":"https://api.github.com/repos/nmiloserdov/queue-flow/milestones{/number}","notifications_url":"https://api.github.com/repos/nmiloserdov/queue-flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmiloserdov/queue-flow/labels{/name}","releases_url":"https://api.github.com/repos/nmiloserdov/queue-flow/releases{/id}","deployments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/deployments","created_at":"2016-03-13T15:44:13Z","updated_at":"2016-03-13T15:48:22Z","pushed_at":"2016-04-14T23:08:25Z","git_url":"git://github.com/nmiloserdov/queue-flow.git","ssh_url":"git@github.com:nmiloserdov/queue-flow.git","clone_url":"https://github.com/nmiloserdov/queue-flow.git","svn_url":"https://github.com/nmiloserdov/queue-flow","homepage":null,"size":115,"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":"nmiloserdov:master","ref":"master","sha":"530519f61689fba2b19faa929f2d17e81c19da65","user":{"login":"nmiloserdov","id":14846508,"avatar_url":"https://avatars.githubusercontent.com/u/14846508?v=3","gravatar_id":"","url":"https://api.github.com/users/nmiloserdov","html_url":"https://github.com/nmiloserdov","followers_url":"https://api.github.com/users/nmiloserdov/followers","following_url":"https://api.github.com/users/nmiloserdov/following{/other_user}","gists_url":"https://api.github.com/users/nmiloserdov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmiloserdov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmiloserdov/subscriptions","organizations_url":"https://api.github.com/users/nmiloserdov/orgs","repos_url":"https://api.github.com/users/nmiloserdov/repos","events_url":"https://api.github.com/users/nmiloserdov/events{/privacy}","received_events_url":"https://api.github.com/users/nmiloserdov/received_events","type":"User","site_admin":false},"repo":{"id":53793006,"name":"queue-flow","full_name":"nmiloserdov/queue-flow","owner":{"login":"nmiloserdov","id":14846508,"avatar_url":"https://avatars.githubusercontent.com/u/14846508?v=3","gravatar_id":"","url":"https://api.github.com/users/nmiloserdov","html_url":"https://github.com/nmiloserdov","followers_url":"https://api.github.com/users/nmiloserdov/followers","following_url":"https://api.github.com/users/nmiloserdov/following{/other_user}","gists_url":"https://api.github.com/users/nmiloserdov/gists{/gist_id}","starred_url":"https://api.github.com/users/nmiloserdov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmiloserdov/subscriptions","organizations_url":"https://api.github.com/users/nmiloserdov/orgs","repos_url":"https://api.github.com/users/nmiloserdov/repos","events_url":"https://api.github.com/users/nmiloserdov/events{/privacy}","received_events_url":"https://api.github.com/users/nmiloserdov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmiloserdov/queue-flow","description":"Stack Overflow clone","fork":false,"url":"https://api.github.com/repos/nmiloserdov/queue-flow","forks_url":"https://api.github.com/repos/nmiloserdov/queue-flow/forks","keys_url":"https://api.github.com/repos/nmiloserdov/queue-flow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmiloserdov/queue-flow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmiloserdov/queue-flow/teams","hooks_url":"https://api.github.com/repos/nmiloserdov/queue-flow/hooks","issue_events_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/events{/number}","events_url":"https://api.github.com/repos/nmiloserdov/queue-flow/events","assignees_url":"https://api.github.com/repos/nmiloserdov/queue-flow/assignees{/user}","branches_url":"https://api.github.com/repos/nmiloserdov/queue-flow/branches{/branch}","tags_url":"https://api.github.com/repos/nmiloserdov/queue-flow/tags","blobs_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmiloserdov/queue-flow/statuses/{sha}","languages_url":"https://api.github.com/repos/nmiloserdov/queue-flow/languages","stargazers_url":"https://api.github.com/repos/nmiloserdov/queue-flow/stargazers","contributors_url":"https://api.github.com/repos/nmiloserdov/queue-flow/contributors","subscribers_url":"https://api.github.com/repos/nmiloserdov/queue-flow/subscribers","subscription_url":"https://api.github.com/repos/nmiloserdov/queue-flow/subscription","commits_url":"https://api.github.com/repos/nmiloserdov/queue-flow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmiloserdov/queue-flow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmiloserdov/queue-flow/contents/{+path}","compare_url":"https://api.github.com/repos/nmiloserdov/queue-flow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmiloserdov/queue-flow/merges","archive_url":"https://api.github.com/repos/nmiloserdov/queue-flow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmiloserdov/queue-flow/downloads","issues_url":"https://api.github.com/repos/nmiloserdov/queue-flow/issues{/number}","pulls_url":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls{/number}","milestones_url":"https://api.github.com/repos/nmiloserdov/queue-flow/milestones{/number}","notifications_url":"https://api.github.com/repos/nmiloserdov/queue-flow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmiloserdov/queue-flow/labels{/name}","releases_url":"https://api.github.com/repos/nmiloserdov/queue-flow/releases{/id}","deployments_url":"https://api.github.com/repos/nmiloserdov/queue-flow/deployments","created_at":"2016-03-13T15:44:13Z","updated_at":"2016-03-13T15:48:22Z","pushed_at":"2016-04-14T23:08:25Z","git_url":"git://github.com/nmiloserdov/queue-flow.git","ssh_url":"git@github.com:nmiloserdov/queue-flow.git","clone_url":"https://github.com/nmiloserdov/queue-flow.git","svn_url":"https://github.com/nmiloserdov/queue-flow","homepage":null,"size":115,"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/nmiloserdov/queue-flow/pulls/6"},"html":{"href":"https://github.com/nmiloserdov/queue-flow/pull/6"},"issue":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/6"},"comments":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/nmiloserdov/queue-flow/statuses/17ca826814cc4c71c58ecb34c1161768366ae65e"}}}}