{"action":"created","comment":{"url":"https://api.github.com/repos/sevon06/flashcards/pulls/comments/57318222","id":57318222,"diff_hunk":"@@ -22,21 +22,24 @@ def self.random_card\n     where('review_date <= ?',  Date.today).order('RANDOM()').take\n   end\n \n-  def check_params(text)\n-    if translated_text.downcase == text.strip.downcase\n-      update(attempts: 3, check_count: check_count + 1)\n-      update(check_count: 1) if check_count > 5 # сбрасывает счетчик, если через месяц вылезла эта карточка, т.к. check_count  не может быть больше 5\n-      set_review_date\n-    else\n-      update(check_count: check_count - 1) if attempts == 0\n-      set_review_date\n-      update(attempts: attempts - 1)\n-      false\n-    end\n+  def check_text?(text)\n+    translated_text.downcase == text.strip.downcase\n   end\n \n+  def incrase_counters\n+    update(attempts: 3, check_count: check_count + 1)\n+    update(check_count: 0) if check_count > 5\n+  end\n+\n+  def decrase_counters\n+    update(attempts: attempts - 1)\n+    update(check_count: check_count - 1, attempts: 3) if attempts == 0","path":"app/models/card.rb","position":35,"original_position":35,"commit_id":"dffc796816b00f2cd25a413e5b9ad011a7ff857d","original_commit_id":"dffc796816b00f2cd25a413e5b9ad011a7ff857d","user":{"login":"davetoxa","id":417317,"avatar_url":"https://avatars.githubusercontent.com/u/417317?v=3","gravatar_id":"","url":"https://api.github.com/users/davetoxa","html_url":"https://github.com/davetoxa","followers_url":"https://api.github.com/users/davetoxa/followers","following_url":"https://api.github.com/users/davetoxa/following{/other_user}","gists_url":"https://api.github.com/users/davetoxa/gists{/gist_id}","starred_url":"https://api.github.com/users/davetoxa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davetoxa/subscriptions","organizations_url":"https://api.github.com/users/davetoxa/orgs","repos_url":"https://api.github.com/users/davetoxa/repos","events_url":"https://api.github.com/users/davetoxa/events{/privacy}","received_events_url":"https://api.github.com/users/davetoxa/received_events","type":"User","site_admin":false},"body":"@sevon06 1 апдейт должен быть, как и в методе выше","created_at":"2016-03-24T13:49:36Z","updated_at":"2016-03-24T13:49:36Z","html_url":"https://github.com/sevon06/flashcards/pull/12#discussion_r57318222","pull_request_url":"https://api.github.com/repos/sevon06/flashcards/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/sevon06/flashcards/pulls/comments/57318222"},"html":{"href":"https://github.com/sevon06/flashcards/pull/12#discussion_r57318222"},"pull_request":{"href":"https://api.github.com/repos/sevon06/flashcards/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/sevon06/flashcards/pulls/12","id":63866465,"html_url":"https://github.com/sevon06/flashcards/pull/12","diff_url":"https://github.com/sevon06/flashcards/pull/12.diff","patch_url":"https://github.com/sevon06/flashcards/pull/12.patch","issue_url":"https://api.github.com/repos/sevon06/flashcards/issues/12","number":12,"state":"open","locked":false,"title":"Task 13","user":{"login":"sevon06","id":8508115,"avatar_url":"https://avatars.githubusercontent.com/u/8508115?v=3","gravatar_id":"","url":"https://api.github.com/users/sevon06","html_url":"https://github.com/sevon06","followers_url":"https://api.github.com/users/sevon06/followers","following_url":"https://api.github.com/users/sevon06/following{/other_user}","gists_url":"https://api.github.com/users/sevon06/gists{/gist_id}","starred_url":"https://api.github.com/users/sevon06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevon06/subscriptions","organizations_url":"https://api.github.com/users/sevon06/orgs","repos_url":"https://api.github.com/users/sevon06/repos","events_url":"https://api.github.com/users/sevon06/events{/privacy}","received_events_url":"https://api.github.com/users/sevon06/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-23T11:21:08Z","updated_at":"2016-03-24T13:49:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b91669ebbf813f831cd8a933cd1a847321b64cbc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sevon06/flashcards/pulls/12/commits","review_comments_url":"https://api.github.com/repos/sevon06/flashcards/pulls/12/comments","review_comment_url":"https://api.github.com/repos/sevon06/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sevon06/flashcards/issues/12/comments","statuses_url":"https://api.github.com/repos/sevon06/flashcards/statuses/dffc796816b00f2cd25a413e5b9ad011a7ff857d","head":{"label":"sevon06:task_13","ref":"task_13","sha":"dffc796816b00f2cd25a413e5b9ad011a7ff857d","user":{"login":"sevon06","id":8508115,"avatar_url":"https://avatars.githubusercontent.com/u/8508115?v=3","gravatar_id":"","url":"https://api.github.com/users/sevon06","html_url":"https://github.com/sevon06","followers_url":"https://api.github.com/users/sevon06/followers","following_url":"https://api.github.com/users/sevon06/following{/other_user}","gists_url":"https://api.github.com/users/sevon06/gists{/gist_id}","starred_url":"https://api.github.com/users/sevon06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevon06/subscriptions","organizations_url":"https://api.github.com/users/sevon06/orgs","repos_url":"https://api.github.com/users/sevon06/repos","events_url":"https://api.github.com/users/sevon06/events{/privacy}","received_events_url":"https://api.github.com/users/sevon06/received_events","type":"User","site_admin":false},"repo":{"id":52263036,"name":"flashcards","full_name":"sevon06/flashcards","owner":{"login":"sevon06","id":8508115,"avatar_url":"https://avatars.githubusercontent.com/u/8508115?v=3","gravatar_id":"","url":"https://api.github.com/users/sevon06","html_url":"https://github.com/sevon06","followers_url":"https://api.github.com/users/sevon06/followers","following_url":"https://api.github.com/users/sevon06/following{/other_user}","gists_url":"https://api.github.com/users/sevon06/gists{/gist_id}","starred_url":"https://api.github.com/users/sevon06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevon06/subscriptions","organizations_url":"https://api.github.com/users/sevon06/orgs","repos_url":"https://api.github.com/users/sevon06/repos","events_url":"https://api.github.com/users/sevon06/events{/privacy}","received_events_url":"https://api.github.com/users/sevon06/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sevon06/flashcards","description":"Уроки по Rails by Mkdev.me","fork":false,"url":"https://api.github.com/repos/sevon06/flashcards","forks_url":"https://api.github.com/repos/sevon06/flashcards/forks","keys_url":"https://api.github.com/repos/sevon06/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sevon06/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sevon06/flashcards/teams","hooks_url":"https://api.github.com/repos/sevon06/flashcards/hooks","issue_events_url":"https://api.github.com/repos/sevon06/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/sevon06/flashcards/events","assignees_url":"https://api.github.com/repos/sevon06/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/sevon06/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/sevon06/flashcards/tags","blobs_url":"https://api.github.com/repos/sevon06/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sevon06/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sevon06/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/sevon06/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sevon06/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/sevon06/flashcards/languages","stargazers_url":"https://api.github.com/repos/sevon06/flashcards/stargazers","contributors_url":"https://api.github.com/repos/sevon06/flashcards/contributors","subscribers_url":"https://api.github.com/repos/sevon06/flashcards/subscribers","subscription_url":"https://api.github.com/repos/sevon06/flashcards/subscription","commits_url":"https://api.github.com/repos/sevon06/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/sevon06/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/sevon06/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/sevon06/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/sevon06/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/sevon06/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sevon06/flashcards/merges","archive_url":"https://api.github.com/repos/sevon06/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sevon06/flashcards/downloads","issues_url":"https://api.github.com/repos/sevon06/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/sevon06/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/sevon06/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/sevon06/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sevon06/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/sevon06/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/sevon06/flashcards/deployments","created_at":"2016-02-22T09:42:15Z","updated_at":"2016-02-24T01:16:14Z","pushed_at":"2016-03-24T13:20:58Z","git_url":"git://github.com/sevon06/flashcards.git","ssh_url":"git@github.com:sevon06/flashcards.git","clone_url":"https://github.com/sevon06/flashcards.git","svn_url":"https://github.com/sevon06/flashcards","homepage":null,"size":1584,"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":"sevon06:master","ref":"master","sha":"685a2aa1932ac63bdbd76ca03b9fba58409684cf","user":{"login":"sevon06","id":8508115,"avatar_url":"https://avatars.githubusercontent.com/u/8508115?v=3","gravatar_id":"","url":"https://api.github.com/users/sevon06","html_url":"https://github.com/sevon06","followers_url":"https://api.github.com/users/sevon06/followers","following_url":"https://api.github.com/users/sevon06/following{/other_user}","gists_url":"https://api.github.com/users/sevon06/gists{/gist_id}","starred_url":"https://api.github.com/users/sevon06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevon06/subscriptions","organizations_url":"https://api.github.com/users/sevon06/orgs","repos_url":"https://api.github.com/users/sevon06/repos","events_url":"https://api.github.com/users/sevon06/events{/privacy}","received_events_url":"https://api.github.com/users/sevon06/received_events","type":"User","site_admin":false},"repo":{"id":52263036,"name":"flashcards","full_name":"sevon06/flashcards","owner":{"login":"sevon06","id":8508115,"avatar_url":"https://avatars.githubusercontent.com/u/8508115?v=3","gravatar_id":"","url":"https://api.github.com/users/sevon06","html_url":"https://github.com/sevon06","followers_url":"https://api.github.com/users/sevon06/followers","following_url":"https://api.github.com/users/sevon06/following{/other_user}","gists_url":"https://api.github.com/users/sevon06/gists{/gist_id}","starred_url":"https://api.github.com/users/sevon06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevon06/subscriptions","organizations_url":"https://api.github.com/users/sevon06/orgs","repos_url":"https://api.github.com/users/sevon06/repos","events_url":"https://api.github.com/users/sevon06/events{/privacy}","received_events_url":"https://api.github.com/users/sevon06/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sevon06/flashcards","description":"Уроки по Rails by Mkdev.me","fork":false,"url":"https://api.github.com/repos/sevon06/flashcards","forks_url":"https://api.github.com/repos/sevon06/flashcards/forks","keys_url":"https://api.github.com/repos/sevon06/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sevon06/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sevon06/flashcards/teams","hooks_url":"https://api.github.com/repos/sevon06/flashcards/hooks","issue_events_url":"https://api.github.com/repos/sevon06/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/sevon06/flashcards/events","assignees_url":"https://api.github.com/repos/sevon06/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/sevon06/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/sevon06/flashcards/tags","blobs_url":"https://api.github.com/repos/sevon06/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sevon06/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sevon06/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/sevon06/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sevon06/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/sevon06/flashcards/languages","stargazers_url":"https://api.github.com/repos/sevon06/flashcards/stargazers","contributors_url":"https://api.github.com/repos/sevon06/flashcards/contributors","subscribers_url":"https://api.github.com/repos/sevon06/flashcards/subscribers","subscription_url":"https://api.github.com/repos/sevon06/flashcards/subscription","commits_url":"https://api.github.com/repos/sevon06/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/sevon06/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/sevon06/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/sevon06/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/sevon06/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/sevon06/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sevon06/flashcards/merges","archive_url":"https://api.github.com/repos/sevon06/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sevon06/flashcards/downloads","issues_url":"https://api.github.com/repos/sevon06/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/sevon06/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/sevon06/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/sevon06/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sevon06/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/sevon06/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/sevon06/flashcards/deployments","created_at":"2016-02-22T09:42:15Z","updated_at":"2016-02-24T01:16:14Z","pushed_at":"2016-03-24T13:20:58Z","git_url":"git://github.com/sevon06/flashcards.git","ssh_url":"git@github.com:sevon06/flashcards.git","clone_url":"https://github.com/sevon06/flashcards.git","svn_url":"https://github.com/sevon06/flashcards","homepage":null,"size":1584,"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/sevon06/flashcards/pulls/12"},"html":{"href":"https://github.com/sevon06/flashcards/pull/12"},"issue":{"href":"https://api.github.com/repos/sevon06/flashcards/issues/12"},"comments":{"href":"https://api.github.com/repos/sevon06/flashcards/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/sevon06/flashcards/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/sevon06/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sevon06/flashcards/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/sevon06/flashcards/statuses/dffc796816b00f2cd25a413e5b9ad011a7ff857d"}}}}