{"action":"created","comment":{"url":"https://api.github.com/repos/Leproslack/saop/pulls/comments/57502894","id":57502894,"diff_hunk":"@@ -0,0 +1,74 @@\n+class FormquestionsController < ApplicationController\n+  before_action :set_formquestion, only: [:show, :destroy]\n+\n+  def calculate_evaluating\n+    score_category = 0\n+      @form.formquestions.each do |cat|","path":"app/controllers/formquestions_controller.rb","position":6,"original_position":6,"commit_id":"8aa39a5a296a3f8cd8f5b34a0a23732afa21a010","original_commit_id":"8aa39a5a296a3f8cd8f5b34a0a23732afa21a010","user":{"login":"kirushik","id":152719,"avatar_url":"https://avatars.githubusercontent.com/u/152719?v=3","gravatar_id":"","url":"https://api.github.com/users/kirushik","html_url":"https://github.com/kirushik","followers_url":"https://api.github.com/users/kirushik/followers","following_url":"https://api.github.com/users/kirushik/following{/other_user}","gists_url":"https://api.github.com/users/kirushik/gists{/gist_id}","starred_url":"https://api.github.com/users/kirushik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirushik/subscriptions","organizations_url":"https://api.github.com/users/kirushik/orgs","repos_url":"https://api.github.com/users/kirushik/repos","events_url":"https://api.github.com/users/kirushik/events{/privacy}","received_events_url":"https://api.github.com/users/kirushik/received_events","type":"User","site_admin":false},"body":"`formquestions` — ужасное название для ассоциации.\r\n\r\nКроме того, `total_score = @form.questsions.sum(:score)` работает заметно быстрее (раз в 10-15 на базе среднего размера), потому что делает всё суммирование внутри БД, доставая в Рельсы только итоговую цифру.\r\n\r\nМеньше оверхеда ⇒ выше скорость и надёжность.","created_at":"2016-03-25T23:43:01Z","updated_at":"2016-03-25T23:43:01Z","html_url":"https://github.com/Leproslack/saop/pull/15#discussion_r57502894","pull_request_url":"https://api.github.com/repos/Leproslack/saop/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/comments/57502894"},"html":{"href":"https://github.com/Leproslack/saop/pull/15#discussion_r57502894"},"pull_request":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/Leproslack/saop/pulls/15","id":64021667,"html_url":"https://github.com/Leproslack/saop/pull/15","diff_url":"https://github.com/Leproslack/saop/pull/15.diff","patch_url":"https://github.com/Leproslack/saop/pull/15.patch","issue_url":"https://api.github.com/repos/Leproslack/saop/issues/15","number":15,"state":"open","locked":false,"title":"Poll form trough","user":{"login":"airwall","id":15384990,"avatar_url":"https://avatars.githubusercontent.com/u/15384990?v=3","gravatar_id":"","url":"https://api.github.com/users/airwall","html_url":"https://github.com/airwall","followers_url":"https://api.github.com/users/airwall/followers","following_url":"https://api.github.com/users/airwall/following{/other_user}","gists_url":"https://api.github.com/users/airwall/gists{/gist_id}","starred_url":"https://api.github.com/users/airwall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airwall/subscriptions","organizations_url":"https://api.github.com/users/airwall/orgs","repos_url":"https://api.github.com/users/airwall/repos","events_url":"https://api.github.com/users/airwall/events{/privacy}","received_events_url":"https://api.github.com/users/airwall/received_events","type":"User","site_admin":false},"body":"Генератор формы опроса Formbuilder. \r\nСоздание опроса, подсчет общей оценки опроса, подсчет оценки категорий опроса.\r\nПоказатель в процентах результата опроса в сравнение с шаблоном.","created_at":"2016-03-24T11:34:35Z","updated_at":"2016-03-25T23:43:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abd15e5f05b51e2c137bebe90ed5688d0dc919cb","assignee":{"login":"kirushik","id":152719,"avatar_url":"https://avatars.githubusercontent.com/u/152719?v=3","gravatar_id":"","url":"https://api.github.com/users/kirushik","html_url":"https://github.com/kirushik","followers_url":"https://api.github.com/users/kirushik/followers","following_url":"https://api.github.com/users/kirushik/following{/other_user}","gists_url":"https://api.github.com/users/kirushik/gists{/gist_id}","starred_url":"https://api.github.com/users/kirushik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirushik/subscriptions","organizations_url":"https://api.github.com/users/kirushik/orgs","repos_url":"https://api.github.com/users/kirushik/repos","events_url":"https://api.github.com/users/kirushik/events{/privacy}","received_events_url":"https://api.github.com/users/kirushik/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Leproslack/saop/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Leproslack/saop/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Leproslack/saop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Leproslack/saop/issues/15/comments","statuses_url":"https://api.github.com/repos/Leproslack/saop/statuses/8aa39a5a296a3f8cd8f5b34a0a23732afa21a010","head":{"label":"Leproslack:poll_form_trough","ref":"poll_form_trough","sha":"8aa39a5a296a3f8cd8f5b34a0a23732afa21a010","user":{"login":"Leproslack","id":17494083,"avatar_url":"https://avatars.githubusercontent.com/u/17494083?v=3","gravatar_id":"","url":"https://api.github.com/users/Leproslack","html_url":"https://github.com/Leproslack","followers_url":"https://api.github.com/users/Leproslack/followers","following_url":"https://api.github.com/users/Leproslack/following{/other_user}","gists_url":"https://api.github.com/users/Leproslack/gists{/gist_id}","starred_url":"https://api.github.com/users/Leproslack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leproslack/subscriptions","organizations_url":"https://api.github.com/users/Leproslack/orgs","repos_url":"https://api.github.com/users/Leproslack/repos","events_url":"https://api.github.com/users/Leproslack/events{/privacy}","received_events_url":"https://api.github.com/users/Leproslack/received_events","type":"Organization","site_admin":false},"repo":{"id":52955398,"name":"saop","full_name":"Leproslack/saop","owner":{"login":"Leproslack","id":17494083,"avatar_url":"https://avatars.githubusercontent.com/u/17494083?v=3","gravatar_id":"","url":"https://api.github.com/users/Leproslack","html_url":"https://github.com/Leproslack","followers_url":"https://api.github.com/users/Leproslack/followers","following_url":"https://api.github.com/users/Leproslack/following{/other_user}","gists_url":"https://api.github.com/users/Leproslack/gists{/gist_id}","starred_url":"https://api.github.com/users/Leproslack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leproslack/subscriptions","organizations_url":"https://api.github.com/users/Leproslack/orgs","repos_url":"https://api.github.com/users/Leproslack/repos","events_url":"https://api.github.com/users/Leproslack/events{/privacy}","received_events_url":"https://api.github.com/users/Leproslack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Leproslack/saop","description":"","fork":false,"url":"https://api.github.com/repos/Leproslack/saop","forks_url":"https://api.github.com/repos/Leproslack/saop/forks","keys_url":"https://api.github.com/repos/Leproslack/saop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Leproslack/saop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Leproslack/saop/teams","hooks_url":"https://api.github.com/repos/Leproslack/saop/hooks","issue_events_url":"https://api.github.com/repos/Leproslack/saop/issues/events{/number}","events_url":"https://api.github.com/repos/Leproslack/saop/events","assignees_url":"https://api.github.com/repos/Leproslack/saop/assignees{/user}","branches_url":"https://api.github.com/repos/Leproslack/saop/branches{/branch}","tags_url":"https://api.github.com/repos/Leproslack/saop/tags","blobs_url":"https://api.github.com/repos/Leproslack/saop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Leproslack/saop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Leproslack/saop/git/refs{/sha}","trees_url":"https://api.github.com/repos/Leproslack/saop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Leproslack/saop/statuses/{sha}","languages_url":"https://api.github.com/repos/Leproslack/saop/languages","stargazers_url":"https://api.github.com/repos/Leproslack/saop/stargazers","contributors_url":"https://api.github.com/repos/Leproslack/saop/contributors","subscribers_url":"https://api.github.com/repos/Leproslack/saop/subscribers","subscription_url":"https://api.github.com/repos/Leproslack/saop/subscription","commits_url":"https://api.github.com/repos/Leproslack/saop/commits{/sha}","git_commits_url":"https://api.github.com/repos/Leproslack/saop/git/commits{/sha}","comments_url":"https://api.github.com/repos/Leproslack/saop/comments{/number}","issue_comment_url":"https://api.github.com/repos/Leproslack/saop/issues/comments{/number}","contents_url":"https://api.github.com/repos/Leproslack/saop/contents/{+path}","compare_url":"https://api.github.com/repos/Leproslack/saop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Leproslack/saop/merges","archive_url":"https://api.github.com/repos/Leproslack/saop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Leproslack/saop/downloads","issues_url":"https://api.github.com/repos/Leproslack/saop/issues{/number}","pulls_url":"https://api.github.com/repos/Leproslack/saop/pulls{/number}","milestones_url":"https://api.github.com/repos/Leproslack/saop/milestones{/number}","notifications_url":"https://api.github.com/repos/Leproslack/saop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Leproslack/saop/labels{/name}","releases_url":"https://api.github.com/repos/Leproslack/saop/releases{/id}","deployments_url":"https://api.github.com/repos/Leproslack/saop/deployments","created_at":"2016-03-02T10:46:16Z","updated_at":"2016-03-02T16:44:07Z","pushed_at":"2016-03-25T23:15:50Z","git_url":"git://github.com/Leproslack/saop.git","ssh_url":"git@github.com:Leproslack/saop.git","clone_url":"https://github.com/Leproslack/saop.git","svn_url":"https://github.com/Leproslack/saop","homepage":null,"size":202,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":13,"forks":2,"open_issues":13,"watchers":0,"default_branch":"master"}},"base":{"label":"Leproslack:master","ref":"master","sha":"6084acbe6a7b94692b5319eec8def3cd5ae3c7ab","user":{"login":"Leproslack","id":17494083,"avatar_url":"https://avatars.githubusercontent.com/u/17494083?v=3","gravatar_id":"","url":"https://api.github.com/users/Leproslack","html_url":"https://github.com/Leproslack","followers_url":"https://api.github.com/users/Leproslack/followers","following_url":"https://api.github.com/users/Leproslack/following{/other_user}","gists_url":"https://api.github.com/users/Leproslack/gists{/gist_id}","starred_url":"https://api.github.com/users/Leproslack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leproslack/subscriptions","organizations_url":"https://api.github.com/users/Leproslack/orgs","repos_url":"https://api.github.com/users/Leproslack/repos","events_url":"https://api.github.com/users/Leproslack/events{/privacy}","received_events_url":"https://api.github.com/users/Leproslack/received_events","type":"Organization","site_admin":false},"repo":{"id":52955398,"name":"saop","full_name":"Leproslack/saop","owner":{"login":"Leproslack","id":17494083,"avatar_url":"https://avatars.githubusercontent.com/u/17494083?v=3","gravatar_id":"","url":"https://api.github.com/users/Leproslack","html_url":"https://github.com/Leproslack","followers_url":"https://api.github.com/users/Leproslack/followers","following_url":"https://api.github.com/users/Leproslack/following{/other_user}","gists_url":"https://api.github.com/users/Leproslack/gists{/gist_id}","starred_url":"https://api.github.com/users/Leproslack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leproslack/subscriptions","organizations_url":"https://api.github.com/users/Leproslack/orgs","repos_url":"https://api.github.com/users/Leproslack/repos","events_url":"https://api.github.com/users/Leproslack/events{/privacy}","received_events_url":"https://api.github.com/users/Leproslack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Leproslack/saop","description":"","fork":false,"url":"https://api.github.com/repos/Leproslack/saop","forks_url":"https://api.github.com/repos/Leproslack/saop/forks","keys_url":"https://api.github.com/repos/Leproslack/saop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Leproslack/saop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Leproslack/saop/teams","hooks_url":"https://api.github.com/repos/Leproslack/saop/hooks","issue_events_url":"https://api.github.com/repos/Leproslack/saop/issues/events{/number}","events_url":"https://api.github.com/repos/Leproslack/saop/events","assignees_url":"https://api.github.com/repos/Leproslack/saop/assignees{/user}","branches_url":"https://api.github.com/repos/Leproslack/saop/branches{/branch}","tags_url":"https://api.github.com/repos/Leproslack/saop/tags","blobs_url":"https://api.github.com/repos/Leproslack/saop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Leproslack/saop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Leproslack/saop/git/refs{/sha}","trees_url":"https://api.github.com/repos/Leproslack/saop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Leproslack/saop/statuses/{sha}","languages_url":"https://api.github.com/repos/Leproslack/saop/languages","stargazers_url":"https://api.github.com/repos/Leproslack/saop/stargazers","contributors_url":"https://api.github.com/repos/Leproslack/saop/contributors","subscribers_url":"https://api.github.com/repos/Leproslack/saop/subscribers","subscription_url":"https://api.github.com/repos/Leproslack/saop/subscription","commits_url":"https://api.github.com/repos/Leproslack/saop/commits{/sha}","git_commits_url":"https://api.github.com/repos/Leproslack/saop/git/commits{/sha}","comments_url":"https://api.github.com/repos/Leproslack/saop/comments{/number}","issue_comment_url":"https://api.github.com/repos/Leproslack/saop/issues/comments{/number}","contents_url":"https://api.github.com/repos/Leproslack/saop/contents/{+path}","compare_url":"https://api.github.com/repos/Leproslack/saop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Leproslack/saop/merges","archive_url":"https://api.github.com/repos/Leproslack/saop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Leproslack/saop/downloads","issues_url":"https://api.github.com/repos/Leproslack/saop/issues{/number}","pulls_url":"https://api.github.com/repos/Leproslack/saop/pulls{/number}","milestones_url":"https://api.github.com/repos/Leproslack/saop/milestones{/number}","notifications_url":"https://api.github.com/repos/Leproslack/saop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Leproslack/saop/labels{/name}","releases_url":"https://api.github.com/repos/Leproslack/saop/releases{/id}","deployments_url":"https://api.github.com/repos/Leproslack/saop/deployments","created_at":"2016-03-02T10:46:16Z","updated_at":"2016-03-02T16:44:07Z","pushed_at":"2016-03-25T23:15:50Z","git_url":"git://github.com/Leproslack/saop.git","ssh_url":"git@github.com:Leproslack/saop.git","clone_url":"https://github.com/Leproslack/saop.git","svn_url":"https://github.com/Leproslack/saop","homepage":null,"size":202,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":13,"forks":2,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/15"},"html":{"href":"https://github.com/Leproslack/saop/pull/15"},"issue":{"href":"https://api.github.com/repos/Leproslack/saop/issues/15"},"comments":{"href":"https://api.github.com/repos/Leproslack/saop/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Leproslack/saop/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Leproslack/saop/statuses/8aa39a5a296a3f8cd8f5b34a0a23732afa21a010"}}}}