{"action":"created","comment":{"url":"https://api.github.com/repos/honestweb/flashcards/pulls/comments/42893235","id":42893235,"diff_hunk":"@@ -1,16 +1,21 @@\n class Card < ActiveRecord::Base\n+  attr_accessor :deck_name\n+\n   belongs_to :user\n+  belongs_to :deck\n \n   mount_uploader :image, ImageUploader\n \n-  validates :original_text, :translated_text, :review_date, :user_id,\n+  validates :original_text, :translated_text, :review_date,\n             presence: true\n+  validates :deck_name, presence: true\n   validate :words_cannot_be_equal\n \n   before_validation :set_review_date, if: :new_record?\n \n-  scope :for_review,        -> { where(\"review_date <= ?\", Time.now) }\n-  scope :random_for_review, -> { for_review.offset(rand(for_review.count)) }\n+  default_scope { order(\"updated_at DESC\") }\n+  scope :all_for_review,        -> { where(\"review_date <= ?\", Time.now) }\n+  scope :random_for_review, -> { all_for_review.offset(rand(all_for_review.count)) }","path":"app/models/card.rb","position":21,"original_position":21,"commit_id":"27201c50ec095f4074eff203d840dbcafcb89cfe","original_commit_id":"27201c50ec095f4074eff203d840dbcafcb89cfe","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":"Line is too long. [84/80]","created_at":"2015-10-23T17:44:51Z","updated_at":"2015-10-23T17:44:51Z","html_url":"https://github.com/honestweb/flashcards/pull/11#discussion_r42893235","pull_request_url":"https://api.github.com/repos/honestweb/flashcards/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/honestweb/flashcards/pulls/comments/42893235"},"html":{"href":"https://github.com/honestweb/flashcards/pull/11#discussion_r42893235"},"pull_request":{"href":"https://api.github.com/repos/honestweb/flashcards/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/honestweb/flashcards/pulls/11","id":47593843,"html_url":"https://github.com/honestweb/flashcards/pull/11","diff_url":"https://github.com/honestweb/flashcards/pull/11.diff","patch_url":"https://github.com/honestweb/flashcards/pull/11.patch","issue_url":"https://api.github.com/repos/honestweb/flashcards/issues/11","number":11,"state":"open","locked":false,"title":"Eleventh task","user":{"login":"honestweb","id":8902399,"avatar_url":"https://avatars.githubusercontent.com/u/8902399?v=3","gravatar_id":"","url":"https://api.github.com/users/honestweb","html_url":"https://github.com/honestweb","followers_url":"https://api.github.com/users/honestweb/followers","following_url":"https://api.github.com/users/honestweb/following{/other_user}","gists_url":"https://api.github.com/users/honestweb/gists{/gist_id}","starred_url":"https://api.github.com/users/honestweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestweb/subscriptions","organizations_url":"https://api.github.com/users/honestweb/orgs","repos_url":"https://api.github.com/users/honestweb/repos","events_url":"https://api.github.com/users/honestweb/events{/privacy}","received_events_url":"https://api.github.com/users/honestweb/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-13T21:54:13Z","updated_at":"2015-10-23T17:44:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee4d7a29b03becbe686c343da64c1db45d592622","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/honestweb/flashcards/pulls/11/commits","review_comments_url":"https://api.github.com/repos/honestweb/flashcards/pulls/11/comments","review_comment_url":"https://api.github.com/repos/honestweb/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/honestweb/flashcards/issues/11/comments","statuses_url":"https://api.github.com/repos/honestweb/flashcards/statuses/27201c50ec095f4074eff203d840dbcafcb89cfe","head":{"label":"honestweb:eleventh-task","ref":"eleventh-task","sha":"27201c50ec095f4074eff203d840dbcafcb89cfe","user":{"login":"honestweb","id":8902399,"avatar_url":"https://avatars.githubusercontent.com/u/8902399?v=3","gravatar_id":"","url":"https://api.github.com/users/honestweb","html_url":"https://github.com/honestweb","followers_url":"https://api.github.com/users/honestweb/followers","following_url":"https://api.github.com/users/honestweb/following{/other_user}","gists_url":"https://api.github.com/users/honestweb/gists{/gist_id}","starred_url":"https://api.github.com/users/honestweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestweb/subscriptions","organizations_url":"https://api.github.com/users/honestweb/orgs","repos_url":"https://api.github.com/users/honestweb/repos","events_url":"https://api.github.com/users/honestweb/events{/privacy}","received_events_url":"https://api.github.com/users/honestweb/received_events","type":"User","site_admin":false},"repo":{"id":42043123,"name":"flashcards","full_name":"honestweb/flashcards","owner":{"login":"honestweb","id":8902399,"avatar_url":"https://avatars.githubusercontent.com/u/8902399?v=3","gravatar_id":"","url":"https://api.github.com/users/honestweb","html_url":"https://github.com/honestweb","followers_url":"https://api.github.com/users/honestweb/followers","following_url":"https://api.github.com/users/honestweb/following{/other_user}","gists_url":"https://api.github.com/users/honestweb/gists{/gist_id}","starred_url":"https://api.github.com/users/honestweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestweb/subscriptions","organizations_url":"https://api.github.com/users/honestweb/orgs","repos_url":"https://api.github.com/users/honestweb/repos","events_url":"https://api.github.com/users/honestweb/events{/privacy}","received_events_url":"https://api.github.com/users/honestweb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/honestweb/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/honestweb/flashcards","forks_url":"https://api.github.com/repos/honestweb/flashcards/forks","keys_url":"https://api.github.com/repos/honestweb/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/honestweb/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/honestweb/flashcards/teams","hooks_url":"https://api.github.com/repos/honestweb/flashcards/hooks","issue_events_url":"https://api.github.com/repos/honestweb/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/honestweb/flashcards/events","assignees_url":"https://api.github.com/repos/honestweb/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/honestweb/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/honestweb/flashcards/tags","blobs_url":"https://api.github.com/repos/honestweb/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/honestweb/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/honestweb/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/honestweb/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/honestweb/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/honestweb/flashcards/languages","stargazers_url":"https://api.github.com/repos/honestweb/flashcards/stargazers","contributors_url":"https://api.github.com/repos/honestweb/flashcards/contributors","subscribers_url":"https://api.github.com/repos/honestweb/flashcards/subscribers","subscription_url":"https://api.github.com/repos/honestweb/flashcards/subscription","commits_url":"https://api.github.com/repos/honestweb/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/honestweb/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/honestweb/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/honestweb/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/honestweb/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/honestweb/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/honestweb/flashcards/merges","archive_url":"https://api.github.com/repos/honestweb/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/honestweb/flashcards/downloads","issues_url":"https://api.github.com/repos/honestweb/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/honestweb/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/honestweb/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/honestweb/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/honestweb/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/honestweb/flashcards/releases{/id}","created_at":"2015-09-07T09:12:04Z","updated_at":"2015-09-26T17:59:14Z","pushed_at":"2015-10-23T17:44:39Z","git_url":"git://github.com/honestweb/flashcards.git","ssh_url":"git@github.com:honestweb/flashcards.git","clone_url":"https://github.com/honestweb/flashcards.git","svn_url":"https://github.com/honestweb/flashcards","homepage":null,"size":636,"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":"honestweb:master","ref":"master","sha":"073e4a14cf2bc1f0b64835b92b9bbc0f0f9da8a7","user":{"login":"honestweb","id":8902399,"avatar_url":"https://avatars.githubusercontent.com/u/8902399?v=3","gravatar_id":"","url":"https://api.github.com/users/honestweb","html_url":"https://github.com/honestweb","followers_url":"https://api.github.com/users/honestweb/followers","following_url":"https://api.github.com/users/honestweb/following{/other_user}","gists_url":"https://api.github.com/users/honestweb/gists{/gist_id}","starred_url":"https://api.github.com/users/honestweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestweb/subscriptions","organizations_url":"https://api.github.com/users/honestweb/orgs","repos_url":"https://api.github.com/users/honestweb/repos","events_url":"https://api.github.com/users/honestweb/events{/privacy}","received_events_url":"https://api.github.com/users/honestweb/received_events","type":"User","site_admin":false},"repo":{"id":42043123,"name":"flashcards","full_name":"honestweb/flashcards","owner":{"login":"honestweb","id":8902399,"avatar_url":"https://avatars.githubusercontent.com/u/8902399?v=3","gravatar_id":"","url":"https://api.github.com/users/honestweb","html_url":"https://github.com/honestweb","followers_url":"https://api.github.com/users/honestweb/followers","following_url":"https://api.github.com/users/honestweb/following{/other_user}","gists_url":"https://api.github.com/users/honestweb/gists{/gist_id}","starred_url":"https://api.github.com/users/honestweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honestweb/subscriptions","organizations_url":"https://api.github.com/users/honestweb/orgs","repos_url":"https://api.github.com/users/honestweb/repos","events_url":"https://api.github.com/users/honestweb/events{/privacy}","received_events_url":"https://api.github.com/users/honestweb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/honestweb/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/honestweb/flashcards","forks_url":"https://api.github.com/repos/honestweb/flashcards/forks","keys_url":"https://api.github.com/repos/honestweb/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/honestweb/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/honestweb/flashcards/teams","hooks_url":"https://api.github.com/repos/honestweb/flashcards/hooks","issue_events_url":"https://api.github.com/repos/honestweb/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/honestweb/flashcards/events","assignees_url":"https://api.github.com/repos/honestweb/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/honestweb/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/honestweb/flashcards/tags","blobs_url":"https://api.github.com/repos/honestweb/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/honestweb/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/honestweb/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/honestweb/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/honestweb/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/honestweb/flashcards/languages","stargazers_url":"https://api.github.com/repos/honestweb/flashcards/stargazers","contributors_url":"https://api.github.com/repos/honestweb/flashcards/contributors","subscribers_url":"https://api.github.com/repos/honestweb/flashcards/subscribers","subscription_url":"https://api.github.com/repos/honestweb/flashcards/subscription","commits_url":"https://api.github.com/repos/honestweb/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/honestweb/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/honestweb/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/honestweb/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/honestweb/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/honestweb/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/honestweb/flashcards/merges","archive_url":"https://api.github.com/repos/honestweb/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/honestweb/flashcards/downloads","issues_url":"https://api.github.com/repos/honestweb/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/honestweb/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/honestweb/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/honestweb/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/honestweb/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/honestweb/flashcards/releases{/id}","created_at":"2015-09-07T09:12:04Z","updated_at":"2015-09-26T17:59:14Z","pushed_at":"2015-10-23T17:44:39Z","git_url":"git://github.com/honestweb/flashcards.git","ssh_url":"git@github.com:honestweb/flashcards.git","clone_url":"https://github.com/honestweb/flashcards.git","svn_url":"https://github.com/honestweb/flashcards","homepage":null,"size":636,"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/honestweb/flashcards/pulls/11"},"html":{"href":"https://github.com/honestweb/flashcards/pull/11"},"issue":{"href":"https://api.github.com/repos/honestweb/flashcards/issues/11"},"comments":{"href":"https://api.github.com/repos/honestweb/flashcards/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/honestweb/flashcards/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/honestweb/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/honestweb/flashcards/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/honestweb/flashcards/statuses/27201c50ec095f4074eff203d840dbcafcb89cfe"}}}}