{"action":"created","comment":{"url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/comments/35293520","id":35293520,"diff_hunk":"@@ -21,13 +19,13 @@ def self.random_overdue\n   def check_translation(user_translation)\n     typos_count = DamerauLevenshtein.distance(downcase_utf(translated_text),\n                                               downcase_utf(user_translation))\n-    if typos_count < 3\n-      if typos_count == 0 && attempts_count != 5\n-        update_review_attributes(attempts_count + 1)\n-      end\n+    update_params = SuperMemo.execute(attempts_count, efactor, interval, repeat, typos_count)\n+    if typos_count == 0\n+      update_params.merge!({ review_date: review_date + interval.days, attempts_count: 0 })\n       { correct: true, typos_count: typos_count }\n     else\n-      update_review_attributes(attempts_count, number_incorrect_attempts + 1)\n+      update_params.merge!({ attempts_count: attempts_count + 1 })","path":"app/models/card.rb","position":23,"original_position":23,"commit_id":"e5cb37018099eb83cbb976dc97489acc60f77d99","original_commit_id":"e5cb37018099eb83cbb976dc97489acc60f77d99","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":"Redundant curly braces around a hash parameter.","created_at":"2015-07-23T06:39:20Z","updated_at":"2015-07-23T06:39:20Z","html_url":"https://github.com/DemidenkoAndrey/flashcards/pull/17#discussion_r35293520","pull_request_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/comments/35293520"},"html":{"href":"https://github.com/DemidenkoAndrey/flashcards/pull/17#discussion_r35293520"},"pull_request":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17","id":40554981,"html_url":"https://github.com/DemidenkoAndrey/flashcards/pull/17","diff_url":"https://github.com/DemidenkoAndrey/flashcards/pull/17.diff","patch_url":"https://github.com/DemidenkoAndrey/flashcards/pull/17.patch","issue_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/17","number":17,"state":"open","locked":false,"title":"Add supermemo and tests for it","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-07-22T11:28:59Z","updated_at":"2015-07-23T06:39:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8b4ced3231defb1bb67fa7e7e4c13808f3d3617","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17/commits","review_comments_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17/comments","review_comment_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/17/comments","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/statuses/e5cb37018099eb83cbb976dc97489acc60f77d99","head":{"label":"DemidenkoAndrey:add-super-memo","ref":"add-super-memo","sha":"e5cb37018099eb83cbb976dc97489acc60f77d99","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":34405016,"name":"flashcards","full_name":"DemidenkoAndrey/flashcards","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/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/flashcards","forks_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/releases{/id}","created_at":"2015-04-22T17:25:31Z","updated_at":"2015-04-25T21:45:50Z","pushed_at":"2015-07-23T06:39:15Z","git_url":"git://github.com/DemidenkoAndrey/flashcards.git","ssh_url":"git@github.com:DemidenkoAndrey/flashcards.git","clone_url":"https://github.com/DemidenkoAndrey/flashcards.git","svn_url":"https://github.com/DemidenkoAndrey/flashcards","homepage":null,"size":1016,"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":"e2bef6afafa6e541b2c9ade1625628cca63d9dc4","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":34405016,"name":"flashcards","full_name":"DemidenkoAndrey/flashcards","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/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/DemidenkoAndrey/flashcards","forks_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/forks","keys_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/teams","hooks_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/hooks","issue_events_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/events","assignees_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/tags","blobs_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/languages","stargazers_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/stargazers","contributors_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/contributors","subscribers_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/subscribers","subscription_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/subscription","commits_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/merges","archive_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/downloads","issues_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/DemidenkoAndrey/flashcards/releases{/id}","created_at":"2015-04-22T17:25:31Z","updated_at":"2015-04-25T21:45:50Z","pushed_at":"2015-07-23T06:39:15Z","git_url":"git://github.com/DemidenkoAndrey/flashcards.git","ssh_url":"git@github.com:DemidenkoAndrey/flashcards.git","clone_url":"https://github.com/DemidenkoAndrey/flashcards.git","svn_url":"https://github.com/DemidenkoAndrey/flashcards","homepage":null,"size":1016,"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/flashcards/pulls/17"},"html":{"href":"https://github.com/DemidenkoAndrey/flashcards/pull/17"},"issue":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/17"},"comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/DemidenkoAndrey/flashcards/statuses/e5cb37018099eb83cbb976dc97489acc60f77d99"}}}}