{"action":"created","comment":{"url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/comments/33245771","id":33245771,"diff_hunk":"@@ -0,0 +1,10 @@\n+class AnyOneValidator < ActiveModel::Validator\n+\n+  def validate(record)\n+    attributes = options[:attributes]\n+    unless attributes.any? { |attribute| record.send(attribute).present? }","path":"app/validators/any_one_validator.rb","position":5,"original_position":5,"commit_id":"b27ab03f054e8918ff416c72fb89a97606f9d352","original_commit_id":"b27ab03f054e8918ff416c72fb89a97606f9d352","user":{"login":"h0tl33t","id":1749474,"avatar_url":"https://avatars.githubusercontent.com/u/1749474?v=3","gravatar_id":"","url":"https://api.github.com/users/h0tl33t","html_url":"https://github.com/h0tl33t","followers_url":"https://api.github.com/users/h0tl33t/followers","following_url":"https://api.github.com/users/h0tl33t/following{/other_user}","gists_url":"https://api.github.com/users/h0tl33t/gists{/gist_id}","starred_url":"https://api.github.com/users/h0tl33t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h0tl33t/subscriptions","organizations_url":"https://api.github.com/users/h0tl33t/orgs","repos_url":"https://api.github.com/users/h0tl33t/repos","events_url":"https://api.github.com/users/h0tl33t/events{/privacy}","received_events_url":"https://api.github.com/users/h0tl33t/received_events","type":"User","site_admin":false},"body":"The positive case might read a bit better:\r\n```\r\nif attributes.none? { |attribute| record.send(attribute).present? }\r\n```","created_at":"2015-06-25T11:41:09Z","updated_at":"2015-06-25T11:41:09Z","html_url":"https://github.com/connorlay/hacker-news-clone/pull/21#discussion_r33245771","pull_request_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/comments/33245771"},"html":{"href":"https://github.com/connorlay/hacker-news-clone/pull/21#discussion_r33245771"},"pull_request":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21","id":38491554,"html_url":"https://github.com/connorlay/hacker-news-clone/pull/21","diff_url":"https://github.com/connorlay/hacker-news-clone/pull/21.diff","patch_url":"https://github.com/connorlay/hacker-news-clone/pull/21.patch","issue_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/21","number":21,"state":"open","locked":false,"title":"Users can post stories.","user":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"body":"resolves #4 \r\n\r\nUsers can post stories that have a title and either a url, text, or both. Stories are displayed on the root page in descending order of creation. A user's profile displays all of the stories they have submitted. A user who is not logged in that attempts to post a new story is redirected to the login page with friendly forwarding.\r\n\r\n![posting a new story](https://cloud.githubusercontent.com/assets/6548350/8342283/310834fe-1a88-11e5-9259-f7f9aa5951a1.gif)\r\n![url validation](https://cloud.githubusercontent.com/assets/6548350/8342292/3e5501a0-1a88-11e5-8169-2a5d95911a10.gif)\r\n![without a url](https://cloud.githubusercontent.com/assets/6548350/8342295/4807232c-1a88-11e5-8d42-95c761ae24a3.gif)\r\n![attempting to post a new story when not signed in](https://cloud.githubusercontent.com/assets/6548350/8342303/51c0ff8c-1a88-11e5-9d46-20cd78578ccb.gif)\r\n","created_at":"2015-06-24T21:47:57Z","updated_at":"2015-06-25T11:41:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0a98139e24964803e4eaa8106976f2e59abeee1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21/commits","review_comments_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21/comments","review_comment_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/21/comments","statuses_url":"https://api.github.com/repos/connorlay/hacker-news-clone/statuses/b27ab03f054e8918ff416c72fb89a97606f9d352","head":{"label":"connorlay:stories","ref":"stories","sha":"b27ab03f054e8918ff416c72fb89a97606f9d352","user":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"repo":{"id":37540166,"name":"hacker-news-clone","full_name":"connorlay/hacker-news-clone","owner":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/connorlay/hacker-news-clone","description":"A clone of Hacker News with minimal dependencies created for my summer 2015 internship at Viget.","fork":false,"url":"https://api.github.com/repos/connorlay/hacker-news-clone","forks_url":"https://api.github.com/repos/connorlay/hacker-news-clone/forks","keys_url":"https://api.github.com/repos/connorlay/hacker-news-clone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/connorlay/hacker-news-clone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/connorlay/hacker-news-clone/teams","hooks_url":"https://api.github.com/repos/connorlay/hacker-news-clone/hooks","issue_events_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/events{/number}","events_url":"https://api.github.com/repos/connorlay/hacker-news-clone/events","assignees_url":"https://api.github.com/repos/connorlay/hacker-news-clone/assignees{/user}","branches_url":"https://api.github.com/repos/connorlay/hacker-news-clone/branches{/branch}","tags_url":"https://api.github.com/repos/connorlay/hacker-news-clone/tags","blobs_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/refs{/sha}","trees_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/connorlay/hacker-news-clone/statuses/{sha}","languages_url":"https://api.github.com/repos/connorlay/hacker-news-clone/languages","stargazers_url":"https://api.github.com/repos/connorlay/hacker-news-clone/stargazers","contributors_url":"https://api.github.com/repos/connorlay/hacker-news-clone/contributors","subscribers_url":"https://api.github.com/repos/connorlay/hacker-news-clone/subscribers","subscription_url":"https://api.github.com/repos/connorlay/hacker-news-clone/subscription","commits_url":"https://api.github.com/repos/connorlay/hacker-news-clone/commits{/sha}","git_commits_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/commits{/sha}","comments_url":"https://api.github.com/repos/connorlay/hacker-news-clone/comments{/number}","issue_comment_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/comments{/number}","contents_url":"https://api.github.com/repos/connorlay/hacker-news-clone/contents/{+path}","compare_url":"https://api.github.com/repos/connorlay/hacker-news-clone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/connorlay/hacker-news-clone/merges","archive_url":"https://api.github.com/repos/connorlay/hacker-news-clone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/connorlay/hacker-news-clone/downloads","issues_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues{/number}","pulls_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls{/number}","milestones_url":"https://api.github.com/repos/connorlay/hacker-news-clone/milestones{/number}","notifications_url":"https://api.github.com/repos/connorlay/hacker-news-clone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/connorlay/hacker-news-clone/labels{/name}","releases_url":"https://api.github.com/repos/connorlay/hacker-news-clone/releases{/id}","created_at":"2015-06-16T15:51:46Z","updated_at":"2015-06-16T19:46:27Z","pushed_at":"2015-06-25T06:40:47Z","git_url":"git://github.com/connorlay/hacker-news-clone.git","ssh_url":"git@github.com:connorlay/hacker-news-clone.git","clone_url":"https://github.com/connorlay/hacker-news-clone.git","svn_url":"https://github.com/connorlay/hacker-news-clone","homepage":null,"size":236,"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":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"connorlay:master","ref":"master","sha":"d1b8fc82ce477e11c29f4f2a61565ca3182be966","user":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"repo":{"id":37540166,"name":"hacker-news-clone","full_name":"connorlay/hacker-news-clone","owner":{"login":"connorlay","id":6548350,"avatar_url":"https://avatars.githubusercontent.com/u/6548350?v=3","gravatar_id":"","url":"https://api.github.com/users/connorlay","html_url":"https://github.com/connorlay","followers_url":"https://api.github.com/users/connorlay/followers","following_url":"https://api.github.com/users/connorlay/following{/other_user}","gists_url":"https://api.github.com/users/connorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/connorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connorlay/subscriptions","organizations_url":"https://api.github.com/users/connorlay/orgs","repos_url":"https://api.github.com/users/connorlay/repos","events_url":"https://api.github.com/users/connorlay/events{/privacy}","received_events_url":"https://api.github.com/users/connorlay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/connorlay/hacker-news-clone","description":"A clone of Hacker News with minimal dependencies created for my summer 2015 internship at Viget.","fork":false,"url":"https://api.github.com/repos/connorlay/hacker-news-clone","forks_url":"https://api.github.com/repos/connorlay/hacker-news-clone/forks","keys_url":"https://api.github.com/repos/connorlay/hacker-news-clone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/connorlay/hacker-news-clone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/connorlay/hacker-news-clone/teams","hooks_url":"https://api.github.com/repos/connorlay/hacker-news-clone/hooks","issue_events_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/events{/number}","events_url":"https://api.github.com/repos/connorlay/hacker-news-clone/events","assignees_url":"https://api.github.com/repos/connorlay/hacker-news-clone/assignees{/user}","branches_url":"https://api.github.com/repos/connorlay/hacker-news-clone/branches{/branch}","tags_url":"https://api.github.com/repos/connorlay/hacker-news-clone/tags","blobs_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/refs{/sha}","trees_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/connorlay/hacker-news-clone/statuses/{sha}","languages_url":"https://api.github.com/repos/connorlay/hacker-news-clone/languages","stargazers_url":"https://api.github.com/repos/connorlay/hacker-news-clone/stargazers","contributors_url":"https://api.github.com/repos/connorlay/hacker-news-clone/contributors","subscribers_url":"https://api.github.com/repos/connorlay/hacker-news-clone/subscribers","subscription_url":"https://api.github.com/repos/connorlay/hacker-news-clone/subscription","commits_url":"https://api.github.com/repos/connorlay/hacker-news-clone/commits{/sha}","git_commits_url":"https://api.github.com/repos/connorlay/hacker-news-clone/git/commits{/sha}","comments_url":"https://api.github.com/repos/connorlay/hacker-news-clone/comments{/number}","issue_comment_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/comments{/number}","contents_url":"https://api.github.com/repos/connorlay/hacker-news-clone/contents/{+path}","compare_url":"https://api.github.com/repos/connorlay/hacker-news-clone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/connorlay/hacker-news-clone/merges","archive_url":"https://api.github.com/repos/connorlay/hacker-news-clone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/connorlay/hacker-news-clone/downloads","issues_url":"https://api.github.com/repos/connorlay/hacker-news-clone/issues{/number}","pulls_url":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls{/number}","milestones_url":"https://api.github.com/repos/connorlay/hacker-news-clone/milestones{/number}","notifications_url":"https://api.github.com/repos/connorlay/hacker-news-clone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/connorlay/hacker-news-clone/labels{/name}","releases_url":"https://api.github.com/repos/connorlay/hacker-news-clone/releases{/id}","created_at":"2015-06-16T15:51:46Z","updated_at":"2015-06-16T19:46:27Z","pushed_at":"2015-06-25T06:40:47Z","git_url":"git://github.com/connorlay/hacker-news-clone.git","ssh_url":"git@github.com:connorlay/hacker-news-clone.git","clone_url":"https://github.com/connorlay/hacker-news-clone.git","svn_url":"https://github.com/connorlay/hacker-news-clone","homepage":null,"size":236,"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":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21"},"html":{"href":"https://github.com/connorlay/hacker-news-clone/pull/21"},"issue":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/21"},"comments":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/connorlay/hacker-news-clone/statuses/b27ab03f054e8918ff416c72fb89a97606f9d352"}}}}