{"action":"created","comment":{"url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/comments/42870407","id":42870407,"diff_hunk":"@@ -1,19 +1,43 @@\n class Car < ActiveRecord::Base\n   belongs_to :train\n \n-  validates :car_type, :upper_bed, :lower_bed, presence: true\n-  validates :number, uniqueness: true\n+  validates :number, uniqueness: { scope: :train }, unless: \"train.nil?\"\n+  validates :type, presence: true\n+  validates :type, inclusion: { in: :car_types }\n \n   before_validation :set_number\n+  before_validation :set_types\n ","path":"lessons_10-plus/tutu/app/models/car.rb","position":12,"original_position":12,"commit_id":"02dc482c72bab122fb1a8bf711d5f32c58fd021d","original_commit_id":"02dc482c72bab122fb1a8bf711d5f32c58fd021d","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"body":"коллбек \"сет_тайп\"","created_at":"2015-10-23T14:25:54Z","updated_at":"2015-10-23T14:25:54Z","html_url":"https://github.com/max-underthesun/TN_repository/pull/5#discussion_r42870407","pull_request_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/comments/42870407"},"html":{"href":"https://github.com/max-underthesun/TN_repository/pull/5#discussion_r42870407"},"pull_request":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5","id":48003581,"html_url":"https://github.com/max-underthesun/TN_repository/pull/5","diff_url":"https://github.com/max-underthesun/TN_repository/pull/5.diff","patch_url":"https://github.com/max-underthesun/TN_repository/pull/5.patch","issue_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/5","number":5,"state":"open","locked":false,"title":"реализация разных типов вагонов через STI ","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-18T07:37:55Z","updated_at":"2015-10-23T14:25:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebf4aa7af8b2c4eba43a75b8efd57ad4dc3928e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5/commits","review_comments_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5/comments","review_comment_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/comments{/number}","comments_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/5/comments","statuses_url":"https://api.github.com/repos/max-underthesun/TN_repository/statuses/02dc482c72bab122fb1a8bf711d5f32c58fd021d","head":{"label":"max-underthesun:cars_types","ref":"cars_types","sha":"02dc482c72bab122fb1a8bf711d5f32c58fd021d","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"repo":{"id":40563522,"name":"TN_repository","full_name":"max-underthesun/TN_repository","owner":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/max-underthesun/TN_repository","description":"","fork":false,"url":"https://api.github.com/repos/max-underthesun/TN_repository","forks_url":"https://api.github.com/repos/max-underthesun/TN_repository/forks","keys_url":"https://api.github.com/repos/max-underthesun/TN_repository/keys{/key_id}","collaborators_url":"https://api.github.com/repos/max-underthesun/TN_repository/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/max-underthesun/TN_repository/teams","hooks_url":"https://api.github.com/repos/max-underthesun/TN_repository/hooks","issue_events_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/events{/number}","events_url":"https://api.github.com/repos/max-underthesun/TN_repository/events","assignees_url":"https://api.github.com/repos/max-underthesun/TN_repository/assignees{/user}","branches_url":"https://api.github.com/repos/max-underthesun/TN_repository/branches{/branch}","tags_url":"https://api.github.com/repos/max-underthesun/TN_repository/tags","blobs_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/refs{/sha}","trees_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/trees{/sha}","statuses_url":"https://api.github.com/repos/max-underthesun/TN_repository/statuses/{sha}","languages_url":"https://api.github.com/repos/max-underthesun/TN_repository/languages","stargazers_url":"https://api.github.com/repos/max-underthesun/TN_repository/stargazers","contributors_url":"https://api.github.com/repos/max-underthesun/TN_repository/contributors","subscribers_url":"https://api.github.com/repos/max-underthesun/TN_repository/subscribers","subscription_url":"https://api.github.com/repos/max-underthesun/TN_repository/subscription","commits_url":"https://api.github.com/repos/max-underthesun/TN_repository/commits{/sha}","git_commits_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/commits{/sha}","comments_url":"https://api.github.com/repos/max-underthesun/TN_repository/comments{/number}","issue_comment_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/comments{/number}","contents_url":"https://api.github.com/repos/max-underthesun/TN_repository/contents/{+path}","compare_url":"https://api.github.com/repos/max-underthesun/TN_repository/compare/{base}...{head}","merges_url":"https://api.github.com/repos/max-underthesun/TN_repository/merges","archive_url":"https://api.github.com/repos/max-underthesun/TN_repository/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/max-underthesun/TN_repository/downloads","issues_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues{/number}","pulls_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls{/number}","milestones_url":"https://api.github.com/repos/max-underthesun/TN_repository/milestones{/number}","notifications_url":"https://api.github.com/repos/max-underthesun/TN_repository/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/max-underthesun/TN_repository/labels{/name}","releases_url":"https://api.github.com/repos/max-underthesun/TN_repository/releases{/id}","created_at":"2015-08-11T20:25:54Z","updated_at":"2015-08-12T13:44:14Z","pushed_at":"2015-10-23T14:13:58Z","git_url":"git://github.com/max-underthesun/TN_repository.git","ssh_url":"git@github.com:max-underthesun/TN_repository.git","clone_url":"https://github.com/max-underthesun/TN_repository.git","svn_url":"https://github.com/max-underthesun/TN_repository","homepage":null,"size":888,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"max-underthesun:master","ref":"master","sha":"eb0d2144ed73f8901c487da7660fe3816aa754ad","user":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"repo":{"id":40563522,"name":"TN_repository","full_name":"max-underthesun/TN_repository","owner":{"login":"max-underthesun","id":13752607,"avatar_url":"https://avatars.githubusercontent.com/u/13752607?v=3","gravatar_id":"","url":"https://api.github.com/users/max-underthesun","html_url":"https://github.com/max-underthesun","followers_url":"https://api.github.com/users/max-underthesun/followers","following_url":"https://api.github.com/users/max-underthesun/following{/other_user}","gists_url":"https://api.github.com/users/max-underthesun/gists{/gist_id}","starred_url":"https://api.github.com/users/max-underthesun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max-underthesun/subscriptions","organizations_url":"https://api.github.com/users/max-underthesun/orgs","repos_url":"https://api.github.com/users/max-underthesun/repos","events_url":"https://api.github.com/users/max-underthesun/events{/privacy}","received_events_url":"https://api.github.com/users/max-underthesun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/max-underthesun/TN_repository","description":"","fork":false,"url":"https://api.github.com/repos/max-underthesun/TN_repository","forks_url":"https://api.github.com/repos/max-underthesun/TN_repository/forks","keys_url":"https://api.github.com/repos/max-underthesun/TN_repository/keys{/key_id}","collaborators_url":"https://api.github.com/repos/max-underthesun/TN_repository/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/max-underthesun/TN_repository/teams","hooks_url":"https://api.github.com/repos/max-underthesun/TN_repository/hooks","issue_events_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/events{/number}","events_url":"https://api.github.com/repos/max-underthesun/TN_repository/events","assignees_url":"https://api.github.com/repos/max-underthesun/TN_repository/assignees{/user}","branches_url":"https://api.github.com/repos/max-underthesun/TN_repository/branches{/branch}","tags_url":"https://api.github.com/repos/max-underthesun/TN_repository/tags","blobs_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/refs{/sha}","trees_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/trees{/sha}","statuses_url":"https://api.github.com/repos/max-underthesun/TN_repository/statuses/{sha}","languages_url":"https://api.github.com/repos/max-underthesun/TN_repository/languages","stargazers_url":"https://api.github.com/repos/max-underthesun/TN_repository/stargazers","contributors_url":"https://api.github.com/repos/max-underthesun/TN_repository/contributors","subscribers_url":"https://api.github.com/repos/max-underthesun/TN_repository/subscribers","subscription_url":"https://api.github.com/repos/max-underthesun/TN_repository/subscription","commits_url":"https://api.github.com/repos/max-underthesun/TN_repository/commits{/sha}","git_commits_url":"https://api.github.com/repos/max-underthesun/TN_repository/git/commits{/sha}","comments_url":"https://api.github.com/repos/max-underthesun/TN_repository/comments{/number}","issue_comment_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues/comments{/number}","contents_url":"https://api.github.com/repos/max-underthesun/TN_repository/contents/{+path}","compare_url":"https://api.github.com/repos/max-underthesun/TN_repository/compare/{base}...{head}","merges_url":"https://api.github.com/repos/max-underthesun/TN_repository/merges","archive_url":"https://api.github.com/repos/max-underthesun/TN_repository/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/max-underthesun/TN_repository/downloads","issues_url":"https://api.github.com/repos/max-underthesun/TN_repository/issues{/number}","pulls_url":"https://api.github.com/repos/max-underthesun/TN_repository/pulls{/number}","milestones_url":"https://api.github.com/repos/max-underthesun/TN_repository/milestones{/number}","notifications_url":"https://api.github.com/repos/max-underthesun/TN_repository/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/max-underthesun/TN_repository/labels{/name}","releases_url":"https://api.github.com/repos/max-underthesun/TN_repository/releases{/id}","created_at":"2015-08-11T20:25:54Z","updated_at":"2015-08-12T13:44:14Z","pushed_at":"2015-10-23T14:13:58Z","git_url":"git://github.com/max-underthesun/TN_repository.git","ssh_url":"git@github.com:max-underthesun/TN_repository.git","clone_url":"https://github.com/max-underthesun/TN_repository.git","svn_url":"https://github.com/max-underthesun/TN_repository","homepage":null,"size":888,"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":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5"},"html":{"href":"https://github.com/max-underthesun/TN_repository/pull/5"},"issue":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/issues/5"},"comments":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/max-underthesun/TN_repository/statuses/02dc482c72bab122fb1a8bf711d5f32c58fd021d"}}}}