{"action":"created","comment":{"url":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments/57458130","id":57458130,"diff_hunk":"@@ -43,6 +43,10 @@ def accounts\n   validates_format_of    :abbreviation, with: /^[a-zA-Z\\d\\-\\.\\s]+$/, message: \"may include letters, numbers, hyphens, spaces, or periods only\"\n   validates_format_of    :journal_mask, with: /^C\\d{2}$/, message: \"must be in the format C##\"\n \n+  validates :order_notification_recipient,\n+    format: { with: /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,6}$/i },","path":"app/models/facility.rb","position":5,"original_position":5,"commit_id":"5cce88ce762b6533873e32308a14876f90737ca7","original_commit_id":"5cce88ce762b6533873e32308a14876f90737ca7","user":{"login":"drench","id":46662,"avatar_url":"https://avatars.githubusercontent.com/u/46662?v=3","gravatar_id":"","url":"https://api.github.com/users/drench","html_url":"https://github.com/drench","followers_url":"https://api.github.com/users/drench/followers","following_url":"https://api.github.com/users/drench/following{/other_user}","gists_url":"https://api.github.com/users/drench/gists{/gist_id}","starred_url":"https://api.github.com/users/drench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drench/subscriptions","organizations_url":"https://api.github.com/users/drench/orgs","repos_url":"https://api.github.com/users/drench/repos","events_url":"https://api.github.com/users/drench/events{/privacy}","received_events_url":"https://api.github.com/users/drench/received_events","type":"User","site_admin":false},"body":"This is lifted from a validation in the `User` model. Do we want to extract a validator, or use something like https://github.com/balexand/email_validator ?","created_at":"2016-03-25T16:04:50Z","updated_at":"2016-03-25T16:04:50Z","html_url":"https://github.com/tablexi/nucore-open/pull/515#discussion_r57458130","pull_request_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/515","_links":{"self":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments/57458130"},"html":{"href":"https://github.com/tablexi/nucore-open/pull/515#discussion_r57458130"},"pull_request":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/515"}}},"pull_request":{"url":"https://api.github.com/repos/tablexi/nucore-open/pulls/515","id":64176637,"html_url":"https://github.com/tablexi/nucore-open/pull/515","diff_url":"https://github.com/tablexi/nucore-open/pull/515.diff","patch_url":"https://github.com/tablexi/nucore-open/pull/515.patch","issue_url":"https://api.github.com/repos/tablexi/nucore-open/issues/515","number":515,"state":"open","locked":false,"title":"[#115285123] Send email notification on order, if configured by facility","user":{"login":"drench","id":46662,"avatar_url":"https://avatars.githubusercontent.com/u/46662?v=3","gravatar_id":"","url":"https://api.github.com/users/drench","html_url":"https://github.com/drench","followers_url":"https://api.github.com/users/drench/followers","following_url":"https://api.github.com/users/drench/following{/other_user}","gists_url":"https://api.github.com/users/drench/gists{/gist_id}","starred_url":"https://api.github.com/users/drench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drench/subscriptions","organizations_url":"https://api.github.com/users/drench/orgs","repos_url":"https://api.github.com/users/drench/repos","events_url":"https://api.github.com/users/drench/events{/privacy}","received_events_url":"https://api.github.com/users/drench/received_events","type":"User","site_admin":false},"body":"This adds `order_notification_recipient` to the `Facility` model.\r\n\r\nIf given a value, this address will receive order notifications. These are generated the same time as receipts, and use the same templates, with minor differences: the `Subject` line is different, and only receipts should say \"Thank you for your order\".\r\n\r\nA major part of this is a refactor of `OrdersController#purchase`. I think it's an improvement though we could definitely go further if want to put more time into it. I left this method's specs mostly as-is since its coverage was near-complete.","created_at":"2016-03-25T15:59:40Z","updated_at":"2016-03-25T16:04:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e33d57f8787c8d150cedf0389e36d3014e8cb092","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/515/commits","review_comments_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/515/comments","review_comment_url":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/issues/515/comments","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/5cce88ce762b6533873e32308a14876f90737ca7","head":{"label":"tablexi:115285123-email-on-order","ref":"115285123-email-on-order","sha":"5cce88ce762b6533873e32308a14876f90737ca7","user":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"repo":{"id":1439473,"name":"nucore-open","full_name":"tablexi/nucore-open","owner":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tablexi/nucore-open","description":"Northwestern University Core Facility Management Software (NUCore)","fork":false,"url":"https://api.github.com/repos/tablexi/nucore-open","forks_url":"https://api.github.com/repos/tablexi/nucore-open/forks","keys_url":"https://api.github.com/repos/tablexi/nucore-open/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tablexi/nucore-open/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tablexi/nucore-open/teams","hooks_url":"https://api.github.com/repos/tablexi/nucore-open/hooks","issue_events_url":"https://api.github.com/repos/tablexi/nucore-open/issues/events{/number}","events_url":"https://api.github.com/repos/tablexi/nucore-open/events","assignees_url":"https://api.github.com/repos/tablexi/nucore-open/assignees{/user}","branches_url":"https://api.github.com/repos/tablexi/nucore-open/branches{/branch}","tags_url":"https://api.github.com/repos/tablexi/nucore-open/tags","blobs_url":"https://api.github.com/repos/tablexi/nucore-open/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tablexi/nucore-open/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tablexi/nucore-open/git/refs{/sha}","trees_url":"https://api.github.com/repos/tablexi/nucore-open/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/{sha}","languages_url":"https://api.github.com/repos/tablexi/nucore-open/languages","stargazers_url":"https://api.github.com/repos/tablexi/nucore-open/stargazers","contributors_url":"https://api.github.com/repos/tablexi/nucore-open/contributors","subscribers_url":"https://api.github.com/repos/tablexi/nucore-open/subscribers","subscription_url":"https://api.github.com/repos/tablexi/nucore-open/subscription","commits_url":"https://api.github.com/repos/tablexi/nucore-open/commits{/sha}","git_commits_url":"https://api.github.com/repos/tablexi/nucore-open/git/commits{/sha}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/comments{/number}","issue_comment_url":"https://api.github.com/repos/tablexi/nucore-open/issues/comments{/number}","contents_url":"https://api.github.com/repos/tablexi/nucore-open/contents/{+path}","compare_url":"https://api.github.com/repos/tablexi/nucore-open/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tablexi/nucore-open/merges","archive_url":"https://api.github.com/repos/tablexi/nucore-open/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tablexi/nucore-open/downloads","issues_url":"https://api.github.com/repos/tablexi/nucore-open/issues{/number}","pulls_url":"https://api.github.com/repos/tablexi/nucore-open/pulls{/number}","milestones_url":"https://api.github.com/repos/tablexi/nucore-open/milestones{/number}","notifications_url":"https://api.github.com/repos/tablexi/nucore-open/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tablexi/nucore-open/labels{/name}","releases_url":"https://api.github.com/repos/tablexi/nucore-open/releases{/id}","deployments_url":"https://api.github.com/repos/tablexi/nucore-open/deployments","created_at":"2011-03-04T13:45:37Z","updated_at":"2015-05-07T22:55:09Z","pushed_at":"2016-03-25T15:59:40Z","git_url":"git://github.com/tablexi/nucore-open.git","ssh_url":"git@github.com:tablexi/nucore-open.git","clone_url":"https://github.com/tablexi/nucore-open.git","svn_url":"https://github.com/tablexi/nucore-open","homepage":"","size":61758,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"tablexi:master","ref":"master","sha":"68ae5b3e11688a6fbabeecae361368e5698dbfe6","user":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"repo":{"id":1439473,"name":"nucore-open","full_name":"tablexi/nucore-open","owner":{"login":"tablexi","id":229702,"avatar_url":"https://avatars.githubusercontent.com/u/229702?v=3","gravatar_id":"","url":"https://api.github.com/users/tablexi","html_url":"https://github.com/tablexi","followers_url":"https://api.github.com/users/tablexi/followers","following_url":"https://api.github.com/users/tablexi/following{/other_user}","gists_url":"https://api.github.com/users/tablexi/gists{/gist_id}","starred_url":"https://api.github.com/users/tablexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tablexi/subscriptions","organizations_url":"https://api.github.com/users/tablexi/orgs","repos_url":"https://api.github.com/users/tablexi/repos","events_url":"https://api.github.com/users/tablexi/events{/privacy}","received_events_url":"https://api.github.com/users/tablexi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tablexi/nucore-open","description":"Northwestern University Core Facility Management Software (NUCore)","fork":false,"url":"https://api.github.com/repos/tablexi/nucore-open","forks_url":"https://api.github.com/repos/tablexi/nucore-open/forks","keys_url":"https://api.github.com/repos/tablexi/nucore-open/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tablexi/nucore-open/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tablexi/nucore-open/teams","hooks_url":"https://api.github.com/repos/tablexi/nucore-open/hooks","issue_events_url":"https://api.github.com/repos/tablexi/nucore-open/issues/events{/number}","events_url":"https://api.github.com/repos/tablexi/nucore-open/events","assignees_url":"https://api.github.com/repos/tablexi/nucore-open/assignees{/user}","branches_url":"https://api.github.com/repos/tablexi/nucore-open/branches{/branch}","tags_url":"https://api.github.com/repos/tablexi/nucore-open/tags","blobs_url":"https://api.github.com/repos/tablexi/nucore-open/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tablexi/nucore-open/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tablexi/nucore-open/git/refs{/sha}","trees_url":"https://api.github.com/repos/tablexi/nucore-open/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tablexi/nucore-open/statuses/{sha}","languages_url":"https://api.github.com/repos/tablexi/nucore-open/languages","stargazers_url":"https://api.github.com/repos/tablexi/nucore-open/stargazers","contributors_url":"https://api.github.com/repos/tablexi/nucore-open/contributors","subscribers_url":"https://api.github.com/repos/tablexi/nucore-open/subscribers","subscription_url":"https://api.github.com/repos/tablexi/nucore-open/subscription","commits_url":"https://api.github.com/repos/tablexi/nucore-open/commits{/sha}","git_commits_url":"https://api.github.com/repos/tablexi/nucore-open/git/commits{/sha}","comments_url":"https://api.github.com/repos/tablexi/nucore-open/comments{/number}","issue_comment_url":"https://api.github.com/repos/tablexi/nucore-open/issues/comments{/number}","contents_url":"https://api.github.com/repos/tablexi/nucore-open/contents/{+path}","compare_url":"https://api.github.com/repos/tablexi/nucore-open/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tablexi/nucore-open/merges","archive_url":"https://api.github.com/repos/tablexi/nucore-open/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tablexi/nucore-open/downloads","issues_url":"https://api.github.com/repos/tablexi/nucore-open/issues{/number}","pulls_url":"https://api.github.com/repos/tablexi/nucore-open/pulls{/number}","milestones_url":"https://api.github.com/repos/tablexi/nucore-open/milestones{/number}","notifications_url":"https://api.github.com/repos/tablexi/nucore-open/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tablexi/nucore-open/labels{/name}","releases_url":"https://api.github.com/repos/tablexi/nucore-open/releases{/id}","deployments_url":"https://api.github.com/repos/tablexi/nucore-open/deployments","created_at":"2011-03-04T13:45:37Z","updated_at":"2015-05-07T22:55:09Z","pushed_at":"2016-03-25T15:59:40Z","git_url":"git://github.com/tablexi/nucore-open.git","ssh_url":"git@github.com:tablexi/nucore-open.git","clone_url":"https://github.com/tablexi/nucore-open.git","svn_url":"https://github.com/tablexi/nucore-open","homepage":"","size":61758,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/515"},"html":{"href":"https://github.com/tablexi/nucore-open/pull/515"},"issue":{"href":"https://api.github.com/repos/tablexi/nucore-open/issues/515"},"comments":{"href":"https://api.github.com/repos/tablexi/nucore-open/issues/515/comments"},"review_comments":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/515/comments"},"review_comment":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tablexi/nucore-open/pulls/515/commits"},"statuses":{"href":"https://api.github.com/repos/tablexi/nucore-open/statuses/5cce88ce762b6533873e32308a14876f90737ca7"}}}}