{"action":"created","comment":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/26263738","id":26263738,"diff_hunk":"@@ -1,63 +1,36 @@\n-class Provisioner < Providers\n-  private\n-\n-  def order_item\n-    @order_item ||= OrderItem.find @order_item_id\n-  end\n-\n-  def product_provisioner\n-    Delayed::Worker.logger.debug \"product type: #{order_item.product.product_type.name}\"\n-    order_item.product.product_type.name\n-  end\n-\n-  def service_type_id\n-    order_item.product.provisionable.service_type_id\n-  end\n+class Provisioner\n+  attr_reader :order_item\n \n-  def order_item_details\n-    details = {}\n-    answers = order_item.product.answers\n-    order_item.product.product_type.questions.each do |question|\n-      answer = answers.select { |row| row.product_type_question_id == question.id }.first\n-      details[question.manageiq_key] = answer.nil? ? question.default : answer.answer\n-    end\n-    details\n+  def self.provision(order_item_id)\n+    perform { |order_item| new(order_item).provision }","path":"app/workers/provisioner.rb","position":28,"original_position":28,"commit_id":"6c3e72c33e4680a4585d12e3551cff21944ca459","original_commit_id":"3636f345c2f887d89d319932c0b32e8b81962824","user":{"login":"stackus","id":158579,"avatar_url":"https://avatars.githubusercontent.com/u/158579?v=3","gravatar_id":"","url":"https://api.github.com/users/stackus","html_url":"https://github.com/stackus","followers_url":"https://api.github.com/users/stackus/followers","following_url":"https://api.github.com/users/stackus/following{/other_user}","gists_url":"https://api.github.com/users/stackus/gists{/gist_id}","starred_url":"https://api.github.com/users/stackus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stackus/subscriptions","organizations_url":"https://api.github.com/users/stackus/orgs","repos_url":"https://api.github.com/users/stackus/repos","events_url":"https://api.github.com/users/stackus/events{/privacy}","received_events_url":"https://api.github.com/users/stackus/received_events","type":"User","site_admin":false},"body":"It's not clicking ATM why you're using a block for order_item lookup. Can you explain?","created_at":"2015-03-11T22:43:08Z","updated_at":"2015-03-11T22:43:08Z","html_url":"https://github.com/projectjellyfish/api/pull/343#discussion_r26263738","pull_request_url":"https://api.github.com/repos/projectjellyfish/api/pulls/343","_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/26263738"},"html":{"href":"https://github.com/projectjellyfish/api/pull/343#discussion_r26263738"},"pull_request":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/343"}}},"pull_request":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/343","id":30990722,"html_url":"https://github.com/projectjellyfish/api/pull/343","diff_url":"https://github.com/projectjellyfish/api/pull/343.diff","patch_url":"https://github.com/projectjellyfish/api/pull/343.patch","issue_url":"https://api.github.com/repos/projectjellyfish/api/issues/343","number":343,"state":"open","locked":false,"title":"Extract Jellyfish::Fog::AWS for fog/aws support","user":{"login":"calebthompson","id":711717,"avatar_url":"https://avatars.githubusercontent.com/u/711717?v=3","gravatar_id":"","url":"https://api.github.com/users/calebthompson","html_url":"https://github.com/calebthompson","followers_url":"https://api.github.com/users/calebthompson/followers","following_url":"https://api.github.com/users/calebthompson/following{/other_user}","gists_url":"https://api.github.com/users/calebthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/calebthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebthompson/subscriptions","organizations_url":"https://api.github.com/users/calebthompson/orgs","repos_url":"https://api.github.com/users/calebthompson/repos","events_url":"https://api.github.com/users/calebthompson/events{/privacy}","received_events_url":"https://api.github.com/users/calebthompson/received_events","type":"User","site_admin":false},"body":"This is an example of how modules that provide products will look. There's still a little bit of work to do for swapping between the product types (currently hard coded to manageiq), but since none of this was hooked up before that's out of scope.\r\n\r\nI'm PR-ing this in api for context, but it'll eventually live in its own repository.\r\n\r\n* Each product type becomes a active record subclass that holds data about its order_item-level configuration (the product_answers and product_questions that were specific to that are represented as columns on this table)\r\n* Each product type row can be related to an order_item as provisional.\r\n* Each product type knows the class that knows how to do actual provisioning, all of which are provisioner subclasses.\r\n* The json included in this PR will be provided by a new class which will map to a subset of current ProductType's current behavior - that it knows how to ask questions that won't ever change. For Fog I don't think there are any such questions, but ManageIQ has a few. This isn't in scope of this change.","created_at":"2015-03-11T22:12:48Z","updated_at":"2015-03-11T22:43:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b11a31007e4383a2856f43a06e9ccd19d302ee50","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectjellyfish/api/pulls/343/commits","review_comments_url":"https://api.github.com/repos/projectjellyfish/api/pulls/343/comments","review_comment_url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectjellyfish/api/issues/343/comments","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/6c3e72c33e4680a4585d12e3551cff21944ca459","head":{"label":"projectjellyfish:jellyfish-fog-aws","ref":"jellyfish-fog-aws","sha":"6c3e72c33e4680a4585d12e3551cff21944ca459","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-03-11T21:24:10Z","pushed_at":"2015-03-11T22:27:15Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":6082,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":75,"forks":5,"open_issues":75,"watchers":16,"default_branch":"master"}},"base":{"label":"projectjellyfish:master","ref":"master","sha":"dc02cd9a87492799df841a6530c885c43f1ccbcb","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-03-11T21:24:10Z","pushed_at":"2015-03-11T22:27:15Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":6082,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":75,"forks":5,"open_issues":75,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/343"},"html":{"href":"https://github.com/projectjellyfish/api/pull/343"},"issue":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/343"},"comments":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/projectjellyfish/api/statuses/6c3e72c33e4680a4585d12e3551cff21944ca459"}}}}