{"action":"created","comment":{"url":"https://api.github.com/repos/ventskus-roman/cards/pulls/comments/29884744","id":29884744,"diff_hunk":"@@ -1,2 +1,24 @@\n class Card < ActiveRecord::Base\n-end\n+  validates :original_text, :translated_text, :review_date, presence: true\n+  validate :check_original_and_translated_not_equals\n+\n+  before_validation :set_default_review_date, :strip_whitespaces, on: :create\n+\n+  def check_original_and_translated_not_equals\n+    if original_text.mb_chars.downcase == translated_text.mb_chars.downcase\n+      errors.add(:translated_text, \"can`t be the same as original text\")\n+    end\n+  end\n+\n+  private\n+    def strip_whitespaces\n+      self.original_text = self.original_text.strip\n+      self.translated_text = self.translated_text.strip\n+    end\n+\n+  private\n+    def set_default_review_date\n+      self.review_date = 3.days.from_now\n+    end\n+\n+end","path":"app/models/card.rb","position":25,"original_position":25,"commit_id":"c74e7374713eae3d3bf886623a5ae00315bef46d","original_commit_id":"c74e7374713eae3d3bf886623a5ae00315bef46d","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":"Final newline missing.","created_at":"2015-05-07T19:01:45Z","updated_at":"2015-05-07T19:01:45Z","html_url":"https://github.com/ventskus-roman/cards/pull/3#discussion_r29884744","pull_request_url":"https://api.github.com/repos/ventskus-roman/cards/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/ventskus-roman/cards/pulls/comments/29884744"},"html":{"href":"https://github.com/ventskus-roman/cards/pull/3#discussion_r29884744"},"pull_request":{"href":"https://api.github.com/repos/ventskus-roman/cards/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/ventskus-roman/cards/pulls/3","id":34836217,"html_url":"https://github.com/ventskus-roman/cards/pull/3","diff_url":"https://github.com/ventskus-roman/cards/pull/3.diff","patch_url":"https://github.com/ventskus-roman/cards/pull/3.patch","issue_url":"https://api.github.com/repos/ventskus-roman/cards/issues/3","number":3,"state":"open","locked":false,"title":"Third task","user":{"login":"ventskus-roman","id":959926,"avatar_url":"https://avatars.githubusercontent.com/u/959926?v=3","gravatar_id":"","url":"https://api.github.com/users/ventskus-roman","html_url":"https://github.com/ventskus-roman","followers_url":"https://api.github.com/users/ventskus-roman/followers","following_url":"https://api.github.com/users/ventskus-roman/following{/other_user}","gists_url":"https://api.github.com/users/ventskus-roman/gists{/gist_id}","starred_url":"https://api.github.com/users/ventskus-roman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ventskus-roman/subscriptions","organizations_url":"https://api.github.com/users/ventskus-roman/orgs","repos_url":"https://api.github.com/users/ventskus-roman/repos","events_url":"https://api.github.com/users/ventskus-roman/events{/privacy}","received_events_url":"https://api.github.com/users/ventskus-roman/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-06T16:44:14Z","updated_at":"2015-05-07T19:01:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30e8177a0db31a43c0f6946492531139a9a03720","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ventskus-roman/cards/pulls/3/commits","review_comments_url":"https://api.github.com/repos/ventskus-roman/cards/pulls/3/comments","review_comment_url":"https://api.github.com/repos/ventskus-roman/cards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ventskus-roman/cards/issues/3/comments","statuses_url":"https://api.github.com/repos/ventskus-roman/cards/statuses/c74e7374713eae3d3bf886623a5ae00315bef46d","head":{"label":"ventskus-roman:third_task","ref":"third_task","sha":"c74e7374713eae3d3bf886623a5ae00315bef46d","user":{"login":"ventskus-roman","id":959926,"avatar_url":"https://avatars.githubusercontent.com/u/959926?v=3","gravatar_id":"","url":"https://api.github.com/users/ventskus-roman","html_url":"https://github.com/ventskus-roman","followers_url":"https://api.github.com/users/ventskus-roman/followers","following_url":"https://api.github.com/users/ventskus-roman/following{/other_user}","gists_url":"https://api.github.com/users/ventskus-roman/gists{/gist_id}","starred_url":"https://api.github.com/users/ventskus-roman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ventskus-roman/subscriptions","organizations_url":"https://api.github.com/users/ventskus-roman/orgs","repos_url":"https://api.github.com/users/ventskus-roman/repos","events_url":"https://api.github.com/users/ventskus-roman/events{/privacy}","received_events_url":"https://api.github.com/users/ventskus-roman/received_events","type":"User","site_admin":false},"repo":{"id":35053822,"name":"cards","full_name":"ventskus-roman/cards","owner":{"login":"ventskus-roman","id":959926,"avatar_url":"https://avatars.githubusercontent.com/u/959926?v=3","gravatar_id":"","url":"https://api.github.com/users/ventskus-roman","html_url":"https://github.com/ventskus-roman","followers_url":"https://api.github.com/users/ventskus-roman/followers","following_url":"https://api.github.com/users/ventskus-roman/following{/other_user}","gists_url":"https://api.github.com/users/ventskus-roman/gists{/gist_id}","starred_url":"https://api.github.com/users/ventskus-roman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ventskus-roman/subscriptions","organizations_url":"https://api.github.com/users/ventskus-roman/orgs","repos_url":"https://api.github.com/users/ventskus-roman/repos","events_url":"https://api.github.com/users/ventskus-roman/events{/privacy}","received_events_url":"https://api.github.com/users/ventskus-roman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ventskus-roman/cards","description":"","fork":false,"url":"https://api.github.com/repos/ventskus-roman/cards","forks_url":"https://api.github.com/repos/ventskus-roman/cards/forks","keys_url":"https://api.github.com/repos/ventskus-roman/cards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ventskus-roman/cards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ventskus-roman/cards/teams","hooks_url":"https://api.github.com/repos/ventskus-roman/cards/hooks","issue_events_url":"https://api.github.com/repos/ventskus-roman/cards/issues/events{/number}","events_url":"https://api.github.com/repos/ventskus-roman/cards/events","assignees_url":"https://api.github.com/repos/ventskus-roman/cards/assignees{/user}","branches_url":"https://api.github.com/repos/ventskus-roman/cards/branches{/branch}","tags_url":"https://api.github.com/repos/ventskus-roman/cards/tags","blobs_url":"https://api.github.com/repos/ventskus-roman/cards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ventskus-roman/cards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ventskus-roman/cards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ventskus-roman/cards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ventskus-roman/cards/statuses/{sha}","languages_url":"https://api.github.com/repos/ventskus-roman/cards/languages","stargazers_url":"https://api.github.com/repos/ventskus-roman/cards/stargazers","contributors_url":"https://api.github.com/repos/ventskus-roman/cards/contributors","subscribers_url":"https://api.github.com/repos/ventskus-roman/cards/subscribers","subscription_url":"https://api.github.com/repos/ventskus-roman/cards/subscription","commits_url":"https://api.github.com/repos/ventskus-roman/cards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ventskus-roman/cards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ventskus-roman/cards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ventskus-roman/cards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ventskus-roman/cards/contents/{+path}","compare_url":"https://api.github.com/repos/ventskus-roman/cards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ventskus-roman/cards/merges","archive_url":"https://api.github.com/repos/ventskus-roman/cards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ventskus-roman/cards/downloads","issues_url":"https://api.github.com/repos/ventskus-roman/cards/issues{/number}","pulls_url":"https://api.github.com/repos/ventskus-roman/cards/pulls{/number}","milestones_url":"https://api.github.com/repos/ventskus-roman/cards/milestones{/number}","notifications_url":"https://api.github.com/repos/ventskus-roman/cards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ventskus-roman/cards/labels{/name}","releases_url":"https://api.github.com/repos/ventskus-roman/cards/releases{/id}","created_at":"2015-05-04T19:07:59Z","updated_at":"2015-05-05T17:40:33Z","pushed_at":"2015-05-07T19:01:34Z","git_url":"git://github.com/ventskus-roman/cards.git","ssh_url":"git@github.com:ventskus-roman/cards.git","clone_url":"https://github.com/ventskus-roman/cards.git","svn_url":"https://github.com/ventskus-roman/cards","homepage":null,"size":0,"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":"ventskus-roman:master","ref":"master","sha":"54ee4eb11578992b47d1c5217527621b98af8244","user":{"login":"ventskus-roman","id":959926,"avatar_url":"https://avatars.githubusercontent.com/u/959926?v=3","gravatar_id":"","url":"https://api.github.com/users/ventskus-roman","html_url":"https://github.com/ventskus-roman","followers_url":"https://api.github.com/users/ventskus-roman/followers","following_url":"https://api.github.com/users/ventskus-roman/following{/other_user}","gists_url":"https://api.github.com/users/ventskus-roman/gists{/gist_id}","starred_url":"https://api.github.com/users/ventskus-roman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ventskus-roman/subscriptions","organizations_url":"https://api.github.com/users/ventskus-roman/orgs","repos_url":"https://api.github.com/users/ventskus-roman/repos","events_url":"https://api.github.com/users/ventskus-roman/events{/privacy}","received_events_url":"https://api.github.com/users/ventskus-roman/received_events","type":"User","site_admin":false},"repo":{"id":35053822,"name":"cards","full_name":"ventskus-roman/cards","owner":{"login":"ventskus-roman","id":959926,"avatar_url":"https://avatars.githubusercontent.com/u/959926?v=3","gravatar_id":"","url":"https://api.github.com/users/ventskus-roman","html_url":"https://github.com/ventskus-roman","followers_url":"https://api.github.com/users/ventskus-roman/followers","following_url":"https://api.github.com/users/ventskus-roman/following{/other_user}","gists_url":"https://api.github.com/users/ventskus-roman/gists{/gist_id}","starred_url":"https://api.github.com/users/ventskus-roman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ventskus-roman/subscriptions","organizations_url":"https://api.github.com/users/ventskus-roman/orgs","repos_url":"https://api.github.com/users/ventskus-roman/repos","events_url":"https://api.github.com/users/ventskus-roman/events{/privacy}","received_events_url":"https://api.github.com/users/ventskus-roman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ventskus-roman/cards","description":"","fork":false,"url":"https://api.github.com/repos/ventskus-roman/cards","forks_url":"https://api.github.com/repos/ventskus-roman/cards/forks","keys_url":"https://api.github.com/repos/ventskus-roman/cards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ventskus-roman/cards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ventskus-roman/cards/teams","hooks_url":"https://api.github.com/repos/ventskus-roman/cards/hooks","issue_events_url":"https://api.github.com/repos/ventskus-roman/cards/issues/events{/number}","events_url":"https://api.github.com/repos/ventskus-roman/cards/events","assignees_url":"https://api.github.com/repos/ventskus-roman/cards/assignees{/user}","branches_url":"https://api.github.com/repos/ventskus-roman/cards/branches{/branch}","tags_url":"https://api.github.com/repos/ventskus-roman/cards/tags","blobs_url":"https://api.github.com/repos/ventskus-roman/cards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ventskus-roman/cards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ventskus-roman/cards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ventskus-roman/cards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ventskus-roman/cards/statuses/{sha}","languages_url":"https://api.github.com/repos/ventskus-roman/cards/languages","stargazers_url":"https://api.github.com/repos/ventskus-roman/cards/stargazers","contributors_url":"https://api.github.com/repos/ventskus-roman/cards/contributors","subscribers_url":"https://api.github.com/repos/ventskus-roman/cards/subscribers","subscription_url":"https://api.github.com/repos/ventskus-roman/cards/subscription","commits_url":"https://api.github.com/repos/ventskus-roman/cards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ventskus-roman/cards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ventskus-roman/cards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ventskus-roman/cards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ventskus-roman/cards/contents/{+path}","compare_url":"https://api.github.com/repos/ventskus-roman/cards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ventskus-roman/cards/merges","archive_url":"https://api.github.com/repos/ventskus-roman/cards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ventskus-roman/cards/downloads","issues_url":"https://api.github.com/repos/ventskus-roman/cards/issues{/number}","pulls_url":"https://api.github.com/repos/ventskus-roman/cards/pulls{/number}","milestones_url":"https://api.github.com/repos/ventskus-roman/cards/milestones{/number}","notifications_url":"https://api.github.com/repos/ventskus-roman/cards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ventskus-roman/cards/labels{/name}","releases_url":"https://api.github.com/repos/ventskus-roman/cards/releases{/id}","created_at":"2015-05-04T19:07:59Z","updated_at":"2015-05-05T17:40:33Z","pushed_at":"2015-05-07T19:01:34Z","git_url":"git://github.com/ventskus-roman/cards.git","ssh_url":"git@github.com:ventskus-roman/cards.git","clone_url":"https://github.com/ventskus-roman/cards.git","svn_url":"https://github.com/ventskus-roman/cards","homepage":null,"size":0,"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/ventskus-roman/cards/pulls/3"},"html":{"href":"https://github.com/ventskus-roman/cards/pull/3"},"issue":{"href":"https://api.github.com/repos/ventskus-roman/cards/issues/3"},"comments":{"href":"https://api.github.com/repos/ventskus-roman/cards/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/ventskus-roman/cards/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/ventskus-roman/cards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ventskus-roman/cards/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/ventskus-roman/cards/statuses/c74e7374713eae3d3bf886623a5ae00315bef46d"}}}}