{"action":"created","comment":{"url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments/27008121","id":27008121,"diff_hunk":"@@ -51,22 +62,67 @@ def create(community_id:, opts:)\n     shape = NewShape.call(opts.merge(community_id: community_id))\n \n     units = shape[:units].map { |unit| Unit.call(unit) }\n+    raise NotImplementedError.new(\"For backward compatibility reasons saving multiple units is not yet supported\") if units.length > 1\n+\n     translations = opts[:translations] # Skip data type and validation, because this is temporary\n \n-    # TODO We should be able to create transaction_type without community\n-    community = Community.find(shape[:community_id])\n+    tt_model = nil\n+\n+    ActiveRecord::Base.transaction do\n+      # TODO We should be able to create transaction_type without community\n+      community = Community.find(shape[:community_id])","path":"app/services/listing_service/store/shape.rb","position":32,"original_position":32,"commit_id":"1bb1ec8737fb364c0e9d51adee2968b26efac120","original_commit_id":"1bb1ec8737fb364c0e9d51adee2968b26efac120","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":"Use community_id attribute in TransactionType model directly instead.","created_at":"2015-03-24T07:54:44Z","updated_at":"2015-03-24T07:54:44Z","html_url":"https://github.com/sharetribe/sharetribe/pull/1083#discussion_r27008121","pull_request_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083","_links":{"self":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments/27008121"},"html":{"href":"https://github.com/sharetribe/sharetribe/pull/1083#discussion_r27008121"},"pull_request":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083"}}},"pull_request":{"url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083","id":31726100,"html_url":"https://github.com/sharetribe/sharetribe/pull/1083","diff_url":"https://github.com/sharetribe/sharetribe/pull/1083.diff","patch_url":"https://github.com/sharetribe/sharetribe/pull/1083.patch","issue_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1083","number":1083,"state":"open","locked":false,"title":"Read units from listing","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":"- [X] Add ListingShape.update\r\n- [X] Instead of reading unit from `listing.transaction_type.price_per`, use `listing.unit_type`\r\n\r\nMerge after #1080 ","created_at":"2015-03-23T12:07:47Z","updated_at":"2015-03-24T07:54:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a3c8b7222d50f3bd1e33dd723c9e5f947b51630","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083/commits","review_comments_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083/comments","review_comment_url":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1083/comments","statuses_url":"https://api.github.com/repos/sharetribe/sharetribe/statuses/1bb1ec8737fb364c0e9d51adee2968b26efac120","head":{"label":"sharetribe:read-units-from-listing","ref":"read-units-from-listing","sha":"1bb1ec8737fb364c0e9d51adee2968b26efac120","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}","created_at":"2012-05-25T15:34:17Z","updated_at":"2015-03-23T19:57:20Z","pushed_at":"2015-03-23T18:41:34Z","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":101442,"stargazers_count":245,"watchers_count":245,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":166,"mirror_url":null,"open_issues_count":13,"forks":166,"open_issues":13,"watchers":245,"default_branch":"master"}},"base":{"label":"sharetribe:master","ref":"master","sha":"a5c4d7841d5d58866d5fac210dae879a9896524b","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}","created_at":"2012-05-25T15:34:17Z","updated_at":"2015-03-23T19:57:20Z","pushed_at":"2015-03-23T18:41:34Z","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":101442,"stargazers_count":245,"watchers_count":245,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":166,"mirror_url":null,"open_issues_count":13,"forks":166,"open_issues":13,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083"},"html":{"href":"https://github.com/sharetribe/sharetribe/pull/1083"},"issue":{"href":"https://api.github.com/repos/sharetribe/sharetribe/issues/1083"},"comments":{"href":"https://api.github.com/repos/sharetribe/sharetribe/issues/1083/comments"},"review_comments":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083/comments"},"review_comment":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sharetribe/sharetribe/pulls/1083/commits"},"statuses":{"href":"https://api.github.com/repos/sharetribe/sharetribe/statuses/1bb1ec8737fb364c0e9d51adee2968b26efac120"}}}}