{"action":"created","comment":{"url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/comments/57703310","id":57703310,"diff_hunk":"@@ -0,0 +1,99 @@\n+class PeopleSubmissionValidator\n+  attr_reader :params, :errors, :is_new_user\n+  def initialize(params)\n+    @params = params\n+    @errors = {}\n+  end\n+\n+  def process(person)\n+    household = check_for_household\n+    household ||= create_new_household\n+    user = person.user || User.new\n+    @is_new_user = user.new_record?\n+    user = check_create_new_user(user)\n+    add_person_attributes(person)\n+    is_invalid?(person)\n+    if errors.empty?\n+      persist_entry(household, user, person)\n+    else\n+      compute_errors(person)\n+    end\n+  end\n+\n+  def persist_entry(household, user, person)","path":"app/utilities/people_submission_validator.rb","position":23,"original_position":23,"commit_id":"44d67909e08703056d88c022972977d0d79659db","original_commit_id":"44d67909e08703056d88c022972977d0d79659db","user":{"login":"andela-ooranagwa","id":11221027,"avatar_url":"https://avatars.githubusercontent.com/u/11221027?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ooranagwa","html_url":"https://github.com/andela-ooranagwa","followers_url":"https://api.github.com/users/andela-ooranagwa/followers","following_url":"https://api.github.com/users/andela-ooranagwa/following{/other_user}","gists_url":"https://api.github.com/users/andela-ooranagwa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ooranagwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ooranagwa/subscriptions","organizations_url":"https://api.github.com/users/andela-ooranagwa/orgs","repos_url":"https://api.github.com/users/andela-ooranagwa/repos","events_url":"https://api.github.com/users/andela-ooranagwa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ooranagwa/received_events","type":"User","site_admin":false},"body":"I've reimplemented it to user `AR transaction` though.","created_at":"2016-03-29T10:42:22Z","updated_at":"2016-03-29T10:42:22Z","html_url":"https://github.com/matthew6project/thirtyone/pull/234#discussion_r57703310","pull_request_url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234","_links":{"self":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/comments/57703310"},"html":{"href":"https://github.com/matthew6project/thirtyone/pull/234#discussion_r57703310"},"pull_request":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234"}}},"pull_request":{"url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234","id":64222470,"html_url":"https://github.com/matthew6project/thirtyone/pull/234","diff_url":"https://github.com/matthew6project/thirtyone/pull/234.diff","patch_url":"https://github.com/matthew6project/thirtyone/pull/234.patch","issue_url":"https://api.github.com/repos/matthew6project/thirtyone/issues/234","number":234,"state":"open","locked":false,"title":"Fix redirect to user page from person","user":{"login":"andela-ooranagwa","id":11221027,"avatar_url":"https://avatars.githubusercontent.com/u/11221027?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ooranagwa","html_url":"https://github.com/andela-ooranagwa","followers_url":"https://api.github.com/users/andela-ooranagwa/followers","following_url":"https://api.github.com/users/andela-ooranagwa/following{/other_user}","gists_url":"https://api.github.com/users/andela-ooranagwa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ooranagwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ooranagwa/subscriptions","organizations_url":"https://api.github.com/users/andela-ooranagwa/orgs","repos_url":"https://api.github.com/users/andela-ooranagwa/repos","events_url":"https://api.github.com/users/andela-ooranagwa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ooranagwa/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-26T00:34:49Z","updated_at":"2016-03-29T10:42:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7de37e1dff8bfb462fa8ab857face4d6a071cefa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234/commits","review_comments_url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234/comments","review_comment_url":"https://api.github.com/repos/matthew6project/thirtyone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matthew6project/thirtyone/issues/234/comments","statuses_url":"https://api.github.com/repos/matthew6project/thirtyone/statuses/44d67909e08703056d88c022972977d0d79659db","head":{"label":"andela-ooranagwa:fix-redirect-to-user-page-from-person","ref":"fix-redirect-to-user-page-from-person","sha":"44d67909e08703056d88c022972977d0d79659db","user":{"login":"andela-ooranagwa","id":11221027,"avatar_url":"https://avatars.githubusercontent.com/u/11221027?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ooranagwa","html_url":"https://github.com/andela-ooranagwa","followers_url":"https://api.github.com/users/andela-ooranagwa/followers","following_url":"https://api.github.com/users/andela-ooranagwa/following{/other_user}","gists_url":"https://api.github.com/users/andela-ooranagwa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ooranagwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ooranagwa/subscriptions","organizations_url":"https://api.github.com/users/andela-ooranagwa/orgs","repos_url":"https://api.github.com/users/andela-ooranagwa/repos","events_url":"https://api.github.com/users/andela-ooranagwa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ooranagwa/received_events","type":"User","site_admin":false},"repo":{"id":54276243,"name":"thirtyone","full_name":"andela-ooranagwa/thirtyone","owner":{"login":"andela-ooranagwa","id":11221027,"avatar_url":"https://avatars.githubusercontent.com/u/11221027?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ooranagwa","html_url":"https://github.com/andela-ooranagwa","followers_url":"https://api.github.com/users/andela-ooranagwa/followers","following_url":"https://api.github.com/users/andela-ooranagwa/following{/other_user}","gists_url":"https://api.github.com/users/andela-ooranagwa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ooranagwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ooranagwa/subscriptions","organizations_url":"https://api.github.com/users/andela-ooranagwa/orgs","repos_url":"https://api.github.com/users/andela-ooranagwa/repos","events_url":"https://api.github.com/users/andela-ooranagwa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ooranagwa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andela-ooranagwa/thirtyone","description":"","fork":true,"url":"https://api.github.com/repos/andela-ooranagwa/thirtyone","forks_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/forks","keys_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/teams","hooks_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/hooks","issue_events_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/issues/events{/number}","events_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/events","assignees_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/assignees{/user}","branches_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/branches{/branch}","tags_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/tags","blobs_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/statuses/{sha}","languages_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/languages","stargazers_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/stargazers","contributors_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/contributors","subscribers_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/subscribers","subscription_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/subscription","commits_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/contents/{+path}","compare_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/merges","archive_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/downloads","issues_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/issues{/number}","pulls_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/pulls{/number}","milestones_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/milestones{/number}","notifications_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/labels{/name}","releases_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/releases{/id}","deployments_url":"https://api.github.com/repos/andela-ooranagwa/thirtyone/deployments","created_at":"2016-03-19T16:43:11Z","updated_at":"2016-03-19T16:43:13Z","pushed_at":"2016-03-28T14:16:54Z","git_url":"git://github.com/andela-ooranagwa/thirtyone.git","ssh_url":"git@github.com:andela-ooranagwa/thirtyone.git","clone_url":"https://github.com/andela-ooranagwa/thirtyone.git","svn_url":"https://github.com/andela-ooranagwa/thirtyone","homepage":null,"size":586,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matthew6project:master","ref":"master","sha":"4ec5aa3a4d14c53c4b47e5b3fe84396f8c32fb59","user":{"login":"matthew6project","id":5482882,"avatar_url":"https://avatars.githubusercontent.com/u/5482882?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew6project","html_url":"https://github.com/matthew6project","followers_url":"https://api.github.com/users/matthew6project/followers","following_url":"https://api.github.com/users/matthew6project/following{/other_user}","gists_url":"https://api.github.com/users/matthew6project/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew6project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew6project/subscriptions","organizations_url":"https://api.github.com/users/matthew6project/orgs","repos_url":"https://api.github.com/users/matthew6project/repos","events_url":"https://api.github.com/users/matthew6project/events{/privacy}","received_events_url":"https://api.github.com/users/matthew6project/received_events","type":"Organization","site_admin":false},"repo":{"id":13607036,"name":"thirtyone","full_name":"matthew6project/thirtyone","owner":{"login":"matthew6project","id":5482882,"avatar_url":"https://avatars.githubusercontent.com/u/5482882?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew6project","html_url":"https://github.com/matthew6project","followers_url":"https://api.github.com/users/matthew6project/followers","following_url":"https://api.github.com/users/matthew6project/following{/other_user}","gists_url":"https://api.github.com/users/matthew6project/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew6project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew6project/subscriptions","organizations_url":"https://api.github.com/users/matthew6project/orgs","repos_url":"https://api.github.com/users/matthew6project/repos","events_url":"https://api.github.com/users/matthew6project/events{/privacy}","received_events_url":"https://api.github.com/users/matthew6project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matthew6project/thirtyone","description":"","fork":false,"url":"https://api.github.com/repos/matthew6project/thirtyone","forks_url":"https://api.github.com/repos/matthew6project/thirtyone/forks","keys_url":"https://api.github.com/repos/matthew6project/thirtyone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthew6project/thirtyone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthew6project/thirtyone/teams","hooks_url":"https://api.github.com/repos/matthew6project/thirtyone/hooks","issue_events_url":"https://api.github.com/repos/matthew6project/thirtyone/issues/events{/number}","events_url":"https://api.github.com/repos/matthew6project/thirtyone/events","assignees_url":"https://api.github.com/repos/matthew6project/thirtyone/assignees{/user}","branches_url":"https://api.github.com/repos/matthew6project/thirtyone/branches{/branch}","tags_url":"https://api.github.com/repos/matthew6project/thirtyone/tags","blobs_url":"https://api.github.com/repos/matthew6project/thirtyone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthew6project/thirtyone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthew6project/thirtyone/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthew6project/thirtyone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthew6project/thirtyone/statuses/{sha}","languages_url":"https://api.github.com/repos/matthew6project/thirtyone/languages","stargazers_url":"https://api.github.com/repos/matthew6project/thirtyone/stargazers","contributors_url":"https://api.github.com/repos/matthew6project/thirtyone/contributors","subscribers_url":"https://api.github.com/repos/matthew6project/thirtyone/subscribers","subscription_url":"https://api.github.com/repos/matthew6project/thirtyone/subscription","commits_url":"https://api.github.com/repos/matthew6project/thirtyone/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthew6project/thirtyone/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthew6project/thirtyone/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthew6project/thirtyone/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthew6project/thirtyone/contents/{+path}","compare_url":"https://api.github.com/repos/matthew6project/thirtyone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthew6project/thirtyone/merges","archive_url":"https://api.github.com/repos/matthew6project/thirtyone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthew6project/thirtyone/downloads","issues_url":"https://api.github.com/repos/matthew6project/thirtyone/issues{/number}","pulls_url":"https://api.github.com/repos/matthew6project/thirtyone/pulls{/number}","milestones_url":"https://api.github.com/repos/matthew6project/thirtyone/milestones{/number}","notifications_url":"https://api.github.com/repos/matthew6project/thirtyone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthew6project/thirtyone/labels{/name}","releases_url":"https://api.github.com/repos/matthew6project/thirtyone/releases{/id}","deployments_url":"https://api.github.com/repos/matthew6project/thirtyone/deployments","created_at":"2013-10-16T01:44:53Z","updated_at":"2016-01-26T00:39:29Z","pushed_at":"2016-03-28T23:49:33Z","git_url":"git://github.com/matthew6project/thirtyone.git","ssh_url":"git@github.com:matthew6project/thirtyone.git","clone_url":"https://github.com/matthew6project/thirtyone.git","svn_url":"https://github.com/matthew6project/thirtyone","homepage":null,"size":620,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":38,"forks":15,"open_issues":38,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234"},"html":{"href":"https://github.com/matthew6project/thirtyone/pull/234"},"issue":{"href":"https://api.github.com/repos/matthew6project/thirtyone/issues/234"},"comments":{"href":"https://api.github.com/repos/matthew6project/thirtyone/issues/234/comments"},"review_comments":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234/comments"},"review_comment":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matthew6project/thirtyone/pulls/234/commits"},"statuses":{"href":"https://api.github.com/repos/matthew6project/thirtyone/statuses/44d67909e08703056d88c022972977d0d79659db"}}}}