{"action":"created","comment":{"url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments/86939945","pull_request_review_id":7571117,"id":86939945,"diff_hunk":"@@ -0,0 +1,82 @@\n+#\n+# This is a base class for jobs that are initiated by a user, i.e.\n+# we know the user ID and marketplace ID\n+#\n+# Features:\n+#\n+# - Saves user/marketplace ID to RequestStore\n+# - Validate/transform params (optional)\n+#\n+# To use this class, make a new subclass:\n+#\n+# ```\n+# class TestJob < BaseUserJob\n+#\n+#   Params = EntityUtils.define_builder(\n+#     [:message, :string, :mandatory]\n+#   )\n+#\n+#   def perform\n+#     puts \"User ID: #{RequestStore[:current_user_id]}\"\n+#     puts \"Marketplace ID: #{RequestStore[:current_community_id]}\"\n+#     puts \"Message #{params[:message]}\"\n+#   end\n+#\n+#   def params_entity(params)\n+#     Params.call(params)\n+#   end\n+# end\n+# ```\n+#\n+# To enqueue a new class:\n+#\n+# ```\n+# Delayed::Job.enqueue(TestJob.new(\n+#   user: {\n+#     id: @current_user.id,\n+#     marketplace_id: @current_community.id\n+#   },\n+#   params: {\n+#     message: \"Test message!\"\n+#   }\n+# }\n+# ```\n+\n+class BaseUserJob\n+  attr_reader :params, :user_info","path":"app/jobs/base_user_job.rb","position":46,"original_position":46,"commit_id":"b8ea0f117e82f25c3c47ac7a971adb2360eb5531","original_commit_id":"b8ea0f117e82f25c3c47ac7a971adb2360eb5531","user":{"login":"ovan","id":271845,"avatar_url":"https://avatars.githubusercontent.com/u/271845?v=3","gravatar_id":"","url":"https://api.github.com/users/ovan","html_url":"https://github.com/ovan","followers_url":"https://api.github.com/users/ovan/followers","following_url":"https://api.github.com/users/ovan/following{/other_user}","gists_url":"https://api.github.com/users/ovan/gists{/gist_id}","starred_url":"https://api.github.com/users/ovan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovan/subscriptions","organizations_url":"https://api.github.com/users/ovan/orgs","repos_url":"https://api.github.com/users/ovan/repos","events_url":"https://api.github.com/users/ovan/events{/privacy}","received_events_url":"https://api.github.com/users/ovan/received_events","type":"User","site_admin":false},"body":":_params, :_user_info ?","created_at":"2016-11-08T08:05:15Z","updated_at":"2016-11-08T08:05:15Z","html_url":"https://github.com/sharetribe/sharetribe/pull/2728#discussion_r86939945","pull_request_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728","_links":{"self":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments/86939945"},"html":{"href":"https://github.com/sharetribe/sharetribe/pull/2728#discussion_r86939945"},"pull_request":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728"}}},"pull_request":{"url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728","id":92595423,"html_url":"https://github.com/sharetribe/sharetribe/pull/2728","diff_url":"https://github.com/sharetribe/sharetribe/pull/2728.diff","patch_url":"https://github.com/sharetribe/sharetribe/pull/2728.patch","issue_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/2728","number":2728,"state":"open","locked":false,"title":"Jobs base class","user":{"login":"rap1ds","id":429876,"avatar_url":"https://avatars.githubusercontent.com/u/429876?v=3","gravatar_id":"","url":"https://api.github.com/users/rap1ds","html_url":"https://github.com/rap1ds","followers_url":"https://api.github.com/users/rap1ds/followers","following_url":"https://api.github.com/users/rap1ds/following{/other_user}","gists_url":"https://api.github.com/users/rap1ds/gists{/gist_id}","starred_url":"https://api.github.com/users/rap1ds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rap1ds/subscriptions","organizations_url":"https://api.github.com/users/rap1ds/orgs","repos_url":"https://api.github.com/users/rap1ds/repos","events_url":"https://api.github.com/users/rap1ds/events{/privacy}","received_events_url":"https://api.github.com/users/rap1ds/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-07T14:44:22Z","updated_at":"2016-11-08T08:05:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0678c4808b7fe9f236921500d279281f198b9627","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728/commits","review_comments_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728/comments","review_comment_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/2728/comments","statuses_url":"https://api.github.com/repos/sharetribe/sharetribe/statuses/b8ea0f117e82f25c3c47ac7a971adb2360eb5531","head":{"label":"sharetribe:jobs-base-class","ref":"jobs-base-class","sha":"b8ea0f117e82f25c3c47ac7a971adb2360eb5531","user":{"login":"sharetribe","id":1733898,"avatar_url":"https://avatars.githubusercontent.com/u/1733898?v=3","gravatar_id":"","url":"https://api.github.com/users/sharetribe","html_url":"https://github.com/sharetribe","followers_url":"https://api.github.com/users/sharetribe/followers","following_url":"https://api.github.com/users/sharetribe/following{/other_user}","gists_url":"https://api.github.com/users/sharetribe/gists{/gist_id}","starred_url":"https://api.github.com/users/sharetribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharetribe/subscriptions","organizations_url":"https://api.github.com/users/sharetribe/orgs","repos_url":"https://api.github.com/users/sharetribe/repos","events_url":"https://api.github.com/users/sharetribe/events{/privacy}","received_events_url":"https://api.github.com/users/sharetribe/received_events","type":"Organization","site_admin":false},"repo":{"id":4447023,"name":"sharetribe","full_name":"sharetribe/sharetribe","owner":{"login":"sharetribe","id":1733898,"avatar_url":"https://avatars.githubusercontent.com/u/1733898?v=3","gravatar_id":"","url":"https://api.github.com/users/sharetribe","html_url":"https://github.com/sharetribe","followers_url":"https://api.github.com/users/sharetribe/followers","following_url":"https://api.github.com/users/sharetribe/following{/other_user}","gists_url":"https://api.github.com/users/sharetribe/gists{/gist_id}","starred_url":"https://api.github.com/users/sharetribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharetribe/subscriptions","organizations_url":"https://api.github.com/users/sharetribe/orgs","repos_url":"https://api.github.com/users/sharetribe/repos","events_url":"https://api.github.com/users/sharetribe/events{/privacy}","received_events_url":"https://api.github.com/users/sharetribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sharetribe/sharetribe","description":"Open source marketplace platform","fork":false,"url":"https://api.github.com/repos/sharetribe/sharetribe","forks_url":"https://api.github.com/repos/sharetribe/sharetribe/forks","keys_url":"https://api.github.com/repos/sharetribe/sharetribe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharetribe/sharetribe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharetribe/sharetribe/teams","hooks_url":"https://api.github.com/repos/sharetribe/sharetribe/hooks","issue_events_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/events{/number}","events_url":"https://api.github.com/repos/sharetribe/sharetribe/events","assignees_url":"https://api.github.com/repos/sharetribe/sharetribe/assignees{/user}","branches_url":"https://api.github.com/repos/sharetribe/sharetribe/branches{/branch}","tags_url":"https://api.github.com/repos/sharetribe/sharetribe/tags","blobs_url":"https://api.github.com/repos/sharetribe/sharetribe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharetribe/sharetribe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharetribe/sharetribe/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharetribe/sharetribe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharetribe/sharetribe/statuses/{sha}","languages_url":"https://api.github.com/repos/sharetribe/sharetribe/languages","stargazers_url":"https://api.github.com/repos/sharetribe/sharetribe/stargazers","contributors_url":"https://api.github.com/repos/sharetribe/sharetribe/contributors","subscribers_url":"https://api.github.com/repos/sharetribe/sharetribe/subscribers","subscription_url":"https://api.github.com/repos/sharetribe/sharetribe/subscription","commits_url":"https://api.github.com/repos/sharetribe/sharetribe/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharetribe/sharetribe/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharetribe/sharetribe/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharetribe/sharetribe/contents/{+path}","compare_url":"https://api.github.com/repos/sharetribe/sharetribe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharetribe/sharetribe/merges","archive_url":"https://api.github.com/repos/sharetribe/sharetribe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharetribe/sharetribe/downloads","issues_url":"https://api.github.com/repos/sharetribe/sharetribe/issues{/number}","pulls_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls{/number}","milestones_url":"https://api.github.com/repos/sharetribe/sharetribe/milestones{/number}","notifications_url":"https://api.github.com/repos/sharetribe/sharetribe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharetribe/sharetribe/labels{/name}","releases_url":"https://api.github.com/repos/sharetribe/sharetribe/releases{/id}","deployments_url":"https://api.github.com/repos/sharetribe/sharetribe/deployments","created_at":"2012-05-25T15:34:17Z","updated_at":"2016-11-07T22:39:12Z","pushed_at":"2016-11-08T06:52:48Z","git_url":"git://github.com/sharetribe/sharetribe.git","ssh_url":"git@github.com:sharetribe/sharetribe.git","clone_url":"https://github.com/sharetribe/sharetribe.git","svn_url":"https://github.com/sharetribe/sharetribe","homepage":"https://www.sharetribe.com","size":121057,"stargazers_count":807,"watchers_count":807,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":551,"mirror_url":null,"open_issues_count":24,"forks":551,"open_issues":24,"watchers":807,"default_branch":"master"}},"base":{"label":"sharetribe:master","ref":"master","sha":"931c85f0ee8b77a4bad4b74252d7b2dbd17a0b04","user":{"login":"sharetribe","id":1733898,"avatar_url":"https://avatars.githubusercontent.com/u/1733898?v=3","gravatar_id":"","url":"https://api.github.com/users/sharetribe","html_url":"https://github.com/sharetribe","followers_url":"https://api.github.com/users/sharetribe/followers","following_url":"https://api.github.com/users/sharetribe/following{/other_user}","gists_url":"https://api.github.com/users/sharetribe/gists{/gist_id}","starred_url":"https://api.github.com/users/sharetribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharetribe/subscriptions","organizations_url":"https://api.github.com/users/sharetribe/orgs","repos_url":"https://api.github.com/users/sharetribe/repos","events_url":"https://api.github.com/users/sharetribe/events{/privacy}","received_events_url":"https://api.github.com/users/sharetribe/received_events","type":"Organization","site_admin":false},"repo":{"id":4447023,"name":"sharetribe","full_name":"sharetribe/sharetribe","owner":{"login":"sharetribe","id":1733898,"avatar_url":"https://avatars.githubusercontent.com/u/1733898?v=3","gravatar_id":"","url":"https://api.github.com/users/sharetribe","html_url":"https://github.com/sharetribe","followers_url":"https://api.github.com/users/sharetribe/followers","following_url":"https://api.github.com/users/sharetribe/following{/other_user}","gists_url":"https://api.github.com/users/sharetribe/gists{/gist_id}","starred_url":"https://api.github.com/users/sharetribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharetribe/subscriptions","organizations_url":"https://api.github.com/users/sharetribe/orgs","repos_url":"https://api.github.com/users/sharetribe/repos","events_url":"https://api.github.com/users/sharetribe/events{/privacy}","received_events_url":"https://api.github.com/users/sharetribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sharetribe/sharetribe","description":"Open source marketplace platform","fork":false,"url":"https://api.github.com/repos/sharetribe/sharetribe","forks_url":"https://api.github.com/repos/sharetribe/sharetribe/forks","keys_url":"https://api.github.com/repos/sharetribe/sharetribe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharetribe/sharetribe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharetribe/sharetribe/teams","hooks_url":"https://api.github.com/repos/sharetribe/sharetribe/hooks","issue_events_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/events{/number}","events_url":"https://api.github.com/repos/sharetribe/sharetribe/events","assignees_url":"https://api.github.com/repos/sharetribe/sharetribe/assignees{/user}","branches_url":"https://api.github.com/repos/sharetribe/sharetribe/branches{/branch}","tags_url":"https://api.github.com/repos/sharetribe/sharetribe/tags","blobs_url":"https://api.github.com/repos/sharetribe/sharetribe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharetribe/sharetribe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharetribe/sharetribe/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharetribe/sharetribe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharetribe/sharetribe/statuses/{sha}","languages_url":"https://api.github.com/repos/sharetribe/sharetribe/languages","stargazers_url":"https://api.github.com/repos/sharetribe/sharetribe/stargazers","contributors_url":"https://api.github.com/repos/sharetribe/sharetribe/contributors","subscribers_url":"https://api.github.com/repos/sharetribe/sharetribe/subscribers","subscription_url":"https://api.github.com/repos/sharetribe/sharetribe/subscription","commits_url":"https://api.github.com/repos/sharetribe/sharetribe/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharetribe/sharetribe/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharetribe/sharetribe/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharetribe/sharetribe/contents/{+path}","compare_url":"https://api.github.com/repos/sharetribe/sharetribe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharetribe/sharetribe/merges","archive_url":"https://api.github.com/repos/sharetribe/sharetribe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharetribe/sharetribe/downloads","issues_url":"https://api.github.com/repos/sharetribe/sharetribe/issues{/number}","pulls_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls{/number}","milestones_url":"https://api.github.com/repos/sharetribe/sharetribe/milestones{/number}","notifications_url":"https://api.github.com/repos/sharetribe/sharetribe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharetribe/sharetribe/labels{/name}","releases_url":"https://api.github.com/repos/sharetribe/sharetribe/releases{/id}","deployments_url":"https://api.github.com/repos/sharetribe/sharetribe/deployments","created_at":"2012-05-25T15:34:17Z","updated_at":"2016-11-07T22:39:12Z","pushed_at":"2016-11-08T06:52:48Z","git_url":"git://github.com/sharetribe/sharetribe.git","ssh_url":"git@github.com:sharetribe/sharetribe.git","clone_url":"https://github.com/sharetribe/sharetribe.git","svn_url":"https://github.com/sharetribe/sharetribe","homepage":"https://www.sharetribe.com","size":121057,"stargazers_count":807,"watchers_count":807,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":551,"mirror_url":null,"open_issues_count":24,"forks":551,"open_issues":24,"watchers":807,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728"},"html":{"href":"https://github.com/sharetribe/sharetribe/pull/2728"},"issue":{"href":"https://api.github.com/repos/sharetribe/sharetribe/issues/2728"},"comments":{"href":"https://api.github.com/repos/sharetribe/sharetribe/issues/2728/comments"},"review_comments":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728/comments"},"review_comment":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/2728/commits"},"statuses":{"href":"https://api.github.com/repos/sharetribe/sharetribe/statuses/b8ea0f117e82f25c3c47ac7a971adb2360eb5531"}}}}
{"actor":{"display_login":"ovan"}}