{"action":"created","comment":{"url":"https://api.github.com/repos/18F/C2/pulls/comments/43941356","id":43941356,"diff_hunk":"@@ -26,14 +26,14 @@ def self.purchase_amount_column_name\n     validates :product_name_and_description, presence: true\n     validates :recurring_interval, presence: true, if: :recurring\n \n-    after_create :add_approvals, :add_observers\n-\n-    def add_approvals\n-      self.proposal.approver = User.for_email(Gsa18f::Procurement.approver_email)\n-    end\n-\n-    def add_observers\n-      self.add_observer(Gsa18f::Procurement.purchaser_email)\n+    after_create :add_steps","path":"app/models/gsa18f/procurement.rb","position":12,"original_position":12,"commit_id":"b8612f181baf663b97d2e430796dd6d73e6c521a","original_commit_id":"b8612f181baf663b97d2e430796dd6d73e6c521a","user":{"login":"yozlet","id":173848,"avatar_url":"https://avatars.githubusercontent.com/u/173848?v=3","gravatar_id":"","url":"https://api.github.com/users/yozlet","html_url":"https://github.com/yozlet","followers_url":"https://api.github.com/users/yozlet/followers","following_url":"https://api.github.com/users/yozlet/following{/other_user}","gists_url":"https://api.github.com/users/yozlet/gists{/gist_id}","starred_url":"https://api.github.com/users/yozlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yozlet/subscriptions","organizations_url":"https://api.github.com/users/yozlet/orgs","repos_url":"https://api.github.com/users/yozlet/repos","events_url":"https://api.github.com/users/yozlet/events{/privacy}","received_events_url":"https://api.github.com/users/yozlet/received_events","type":"User","site_admin":false},"body":"Callback removed! Step addition is now triggered by the controller.\r\nI needed to add an `after(:create)` in the `Procurement` factory, but that's OK, right?","created_at":"2015-11-04T21:22:52Z","updated_at":"2015-11-04T21:22:52Z","html_url":"https://github.com/18F/C2/pull/722#discussion_r43941356","pull_request_url":"https://api.github.com/repos/18F/C2/pulls/722","_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/comments/43941356"},"html":{"href":"https://github.com/18F/C2/pull/722#discussion_r43941356"},"pull_request":{"href":"https://api.github.com/repos/18F/C2/pulls/722"}}},"pull_request":{"url":"https://api.github.com/repos/18F/C2/pulls/722","id":48269527,"html_url":"https://github.com/18F/C2/pull/722","diff_url":"https://github.com/18F/C2/pull/722.diff","patch_url":"https://github.com/18F/C2/pull/722.patch","issue_url":"https://api.github.com/repos/18F/C2/issues/722","number":722,"state":"open","locked":false,"title":"[Delivers #98295520] Add purchase step to 18F procurements","user":{"login":"yozlet","id":173848,"avatar_url":"https://avatars.githubusercontent.com/u/173848?v=3","gravatar_id":"","url":"https://api.github.com/users/yozlet","html_url":"https://github.com/yozlet","followers_url":"https://api.github.com/users/yozlet/followers","following_url":"https://api.github.com/users/yozlet/following{/other_user}","gists_url":"https://api.github.com/users/yozlet/gists{/gist_id}","starred_url":"https://api.github.com/users/yozlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yozlet/subscriptions","organizations_url":"https://api.github.com/users/yozlet/orgs","repos_url":"https://api.github.com/users/yozlet/repos","events_url":"https://api.github.com/users/yozlet/events{/privacy}","received_events_url":"https://api.github.com/users/yozlet/received_events","type":"User","site_admin":false},"body":"@annalee and I are doing this by generalising `Approval` to include other kinds of steps. As part of this, renaming `Approval` to `Step`.\r\n\r\n - [x] Rename `Approval` -> `Step`\r\n - [x] Rename `Approvals::*` -> `Steps::*`\r\n - [x] Rename `steps`/`approvals_user_proposal_idx` in schema\r\n - [x] Check that API output change is OK (`spec/requests/api/ncr/work_orders_spec.rb:99`) - if so, update API documentation\r\n - [x] Migration to change `Approvals::Serial` to `Steps::Serial` etc. in the `type` column of the (new) `steps` table (thanks, Aidan)\r\n - [x] If we're subclassing `Steps::Individual` to `Approval` and `Purchase`, then the above migration also needs to handle that renaming\r\n - [x] The actual feature addition we came here for (see below)\r\n\r\nNot doing:\r\n - _Rename `Approval` factory and all usages_ - keeping this as `:approval`, but now it creates a `Steps::Approval`, not a `Steps::Individual`\r\n - _Rename `ApprovalDelegate` -> `StepDelegate`_ - Do this in a later PR\r\n\r\n**User-facing changes:**\r\n- In 18F procurements: Create a new Purchase step after initial Approval step\r\n- Change button labeling for Purchase Step from \"Approve\" to \"Mark As Purchased\"","created_at":"2015-10-20T23:04:30Z","updated_at":"2015-11-04T21:22:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e143d44a5796dfbebf7563f1d766a554f757e5e2","assignee":{"login":"yozlet","id":173848,"avatar_url":"https://avatars.githubusercontent.com/u/173848?v=3","gravatar_id":"","url":"https://api.github.com/users/yozlet","html_url":"https://github.com/yozlet","followers_url":"https://api.github.com/users/yozlet/followers","following_url":"https://api.github.com/users/yozlet/following{/other_user}","gists_url":"https://api.github.com/users/yozlet/gists{/gist_id}","starred_url":"https://api.github.com/users/yozlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yozlet/subscriptions","organizations_url":"https://api.github.com/users/yozlet/orgs","repos_url":"https://api.github.com/users/yozlet/repos","events_url":"https://api.github.com/users/yozlet/events{/privacy}","received_events_url":"https://api.github.com/users/yozlet/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/18F/C2/pulls/722/commits","review_comments_url":"https://api.github.com/repos/18F/C2/pulls/722/comments","review_comment_url":"https://api.github.com/repos/18F/C2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/C2/issues/722/comments","statuses_url":"https://api.github.com/repos/18F/C2/statuses/b8612f181baf663b97d2e430796dd6d73e6c521a","head":{"label":"18F:98295520-purchase-step","ref":"98295520-purchase-step","sha":"b8612f181baf663b97d2e430796dd6d73e6c521a","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-10-29T20:06:23Z","pushed_at":"2015-11-04T20:57:47Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":90405,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":28,"forks":15,"open_issues":28,"watchers":29,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"7e6956e2083f848d36e18f2bb8b95f2e93af574a","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-10-29T20:06:23Z","pushed_at":"2015-11-04T20:57:47Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":90405,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":28,"forks":15,"open_issues":28,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/722"},"html":{"href":"https://github.com/18F/C2/pull/722"},"issue":{"href":"https://api.github.com/repos/18F/C2/issues/722"},"comments":{"href":"https://api.github.com/repos/18F/C2/issues/722/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/C2/pulls/722/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/C2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/C2/pulls/722/commits"},"statuses":{"href":"https://api.github.com/repos/18F/C2/statuses/b8612f181baf663b97d2e430796dd6d73e6c521a"}}}}