{"action":"created","comment":{"url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/comments/245466449","pull_request_review_id":189584911,"id":245466449,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTQ2NjQ0OQ==","diff_hunk":"@@ -10,11 +14,15 @@ def list_books(books)\n   end\n \n   get '/books/writable' do\n-    list_books Book.allowed(current_user.permissions)\n+    list_books Book.allowed(permissions)\n   end\n \n   get '/books/:organization/:repository' do\n-    Book.find_by_slug!(slug.to_s).to_resource_h\n+    book.to_resource_h\n+  end\n+\n+  get '/books/:organization/:repository/organizations' do\n+    organizations_for book, Organization.where(book_id: book.id)","path":"lib/mumuki/bibliotheca/sinatra/books.rb","position":24,"original_position":24,"commit_id":"b1dc5f9dc3425768748436758419964497622778","original_commit_id":"b1dc5f9dc3425768748436758419964497622778","user":{"login":"rodri042","id":1631752,"node_id":"MDQ6VXNlcjE2MzE3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1631752?v=4","gravatar_id":"","url":"https://api.github.com/users/rodri042","html_url":"https://github.com/rodri042","followers_url":"https://api.github.com/users/rodri042/followers","following_url":"https://api.github.com/users/rodri042/following{/other_user}","gists_url":"https://api.github.com/users/rodri042/gists{/gist_id}","starred_url":"https://api.github.com/users/rodri042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodri042/subscriptions","organizations_url":"https://api.github.com/users/rodri042/orgs","repos_url":"https://api.github.com/users/rodri042/repos","events_url":"https://api.github.com/users/rodri042/events{/privacy}","received_events_url":"https://api.github.com/users/rodri042/received_events","type":"User","site_admin":false},"body":"I don't know why my development environment contains usages of a Book, when the `book_id` is other. I have to add this filter to make it work like it was before the `with_usage(...)` change.\r\n\r\nIf this is a error and it shouldn't happen in production, I'd revert https://github.com/mumuki/mumuki-bibliotheca-api/pull/140/commits/b1dc5f9dc3425768748436758419964497622778","created_at":"2019-01-05T04:20:28Z","updated_at":"2019-01-05T04:20:28Z","html_url":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140#discussion_r245466449","pull_request_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/comments/245466449"},"html":{"href":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140#discussion_r245466449"},"pull_request":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140"}}},"pull_request":{"url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140","id":241415200,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNDE1MjAw","html_url":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140","diff_url":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140.diff","patch_url":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140.patch","issue_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/140","number":140,"state":"open","locked":false,"title":"Get organizations from book","user":{"login":"rodri042","id":1631752,"node_id":"MDQ6VXNlcjE2MzE3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1631752?v=4","gravatar_id":"","url":"https://api.github.com/users/rodri042","html_url":"https://github.com/rodri042","followers_url":"https://api.github.com/users/rodri042/followers","following_url":"https://api.github.com/users/rodri042/following{/other_user}","gists_url":"https://api.github.com/users/rodri042/gists{/gist_id}","starred_url":"https://api.github.com/users/rodri042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodri042/subscriptions","organizations_url":"https://api.github.com/users/rodri042/orgs","repos_url":"https://api.github.com/users/rodri042/repos","events_url":"https://api.github.com/users/rodri042/events{/privacy}","received_events_url":"https://api.github.com/users/rodri042/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/mumuki/mumuki-domain/pull/11\r\n\r\n:warning: Update `mumuki-domain` before merging.","created_at":"2018-12-29T00:58:27Z","updated_at":"2019-01-05T04:20:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ed750afc3bcc105595e49f69633bb9e846960c0","assignee":{"login":"rodri042","id":1631752,"node_id":"MDQ6VXNlcjE2MzE3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1631752?v=4","gravatar_id":"","url":"https://api.github.com/users/rodri042","html_url":"https://github.com/rodri042","followers_url":"https://api.github.com/users/rodri042/followers","following_url":"https://api.github.com/users/rodri042/following{/other_user}","gists_url":"https://api.github.com/users/rodri042/gists{/gist_id}","starred_url":"https://api.github.com/users/rodri042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodri042/subscriptions","organizations_url":"https://api.github.com/users/rodri042/orgs","repos_url":"https://api.github.com/users/rodri042/repos","events_url":"https://api.github.com/users/rodri042/events{/privacy}","received_events_url":"https://api.github.com/users/rodri042/received_events","type":"User","site_admin":false},"assignees":[{"login":"rodri042","id":1631752,"node_id":"MDQ6VXNlcjE2MzE3NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1631752?v=4","gravatar_id":"","url":"https://api.github.com/users/rodri042","html_url":"https://github.com/rodri042","followers_url":"https://api.github.com/users/rodri042/followers","following_url":"https://api.github.com/users/rodri042/following{/other_user}","gists_url":"https://api.github.com/users/rodri042/gists{/gist_id}","starred_url":"https://api.github.com/users/rodri042/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodri042/subscriptions","organizations_url":"https://api.github.com/users/rodri042/orgs","repos_url":"https://api.github.com/users/rodri042/repos","events_url":"https://api.github.com/users/rodri042/events{/privacy}","received_events_url":"https://api.github.com/users/rodri042/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":535901187,"node_id":"MDU6TGFiZWw1MzU5MDExODc=","url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/labels/pending-review","name":"pending-review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140/commits","review_comments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140/comments","review_comment_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/140/comments","statuses_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/statuses/b1dc5f9dc3425768748436758419964497622778","head":{"label":"mumuki:get-organizations-from-book","ref":"get-organizations-from-book","sha":"b1dc5f9dc3425768748436758419964497622778","user":{"login":"mumuki","id":10385254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMzg1MjU0","avatar_url":"https://avatars2.githubusercontent.com/u/10385254?v=4","gravatar_id":"","url":"https://api.github.com/users/mumuki","html_url":"https://github.com/mumuki","followers_url":"https://api.github.com/users/mumuki/followers","following_url":"https://api.github.com/users/mumuki/following{/other_user}","gists_url":"https://api.github.com/users/mumuki/gists{/gist_id}","starred_url":"https://api.github.com/users/mumuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumuki/subscriptions","organizations_url":"https://api.github.com/users/mumuki/orgs","repos_url":"https://api.github.com/users/mumuki/repos","events_url":"https://api.github.com/users/mumuki/events{/privacy}","received_events_url":"https://api.github.com/users/mumuki/received_events","type":"Organization","site_admin":false},"repo":{"id":44509699,"node_id":"MDEwOlJlcG9zaXRvcnk0NDUwOTY5OQ==","name":"mumuki-bibliotheca-api","full_name":"mumuki/mumuki-bibliotheca-api","private":false,"owner":{"login":"mumuki","id":10385254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMzg1MjU0","avatar_url":"https://avatars2.githubusercontent.com/u/10385254?v=4","gravatar_id":"","url":"https://api.github.com/users/mumuki","html_url":"https://github.com/mumuki","followers_url":"https://api.github.com/users/mumuki/followers","following_url":"https://api.github.com/users/mumuki/following{/other_user}","gists_url":"https://api.github.com/users/mumuki/gists{/gist_id}","starred_url":"https://api.github.com/users/mumuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumuki/subscriptions","organizations_url":"https://api.github.com/users/mumuki/orgs","repos_url":"https://api.github.com/users/mumuki/repos","events_url":"https://api.github.com/users/mumuki/events{/privacy}","received_events_url":"https://api.github.com/users/mumuki/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mumuki/mumuki-bibliotheca-api","description":"Storage and formatting API for Mumuki content","fork":false,"url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api","forks_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/forks","keys_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/teams","hooks_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/hooks","issue_events_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/events{/number}","events_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/events","assignees_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/assignees{/user}","branches_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/branches{/branch}","tags_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/tags","blobs_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/statuses/{sha}","languages_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/languages","stargazers_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/stargazers","contributors_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/contributors","subscribers_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/subscribers","subscription_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/subscription","commits_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/contents/{+path}","compare_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/merges","archive_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/downloads","issues_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues{/number}","pulls_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls{/number}","milestones_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/milestones{/number}","notifications_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/labels{/name}","releases_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/releases{/id}","deployments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/deployments","created_at":"2015-10-19T03:42:42Z","updated_at":"2019-01-01T22:04:32Z","pushed_at":"2019-01-05T04:12:16Z","git_url":"git://github.com/mumuki/mumuki-bibliotheca-api.git","ssh_url":"git@github.com:mumuki/mumuki-bibliotheca-api.git","clone_url":"https://github.com/mumuki/mumuki-bibliotheca-api.git","svn_url":"https://github.com/mumuki/mumuki-bibliotheca-api","homepage":"","size":620,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":14,"watchers":4,"default_branch":"master"}},"base":{"label":"mumuki:master","ref":"master","sha":"b152cf243e55977db150e075862fa929cee3f361","user":{"login":"mumuki","id":10385254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMzg1MjU0","avatar_url":"https://avatars2.githubusercontent.com/u/10385254?v=4","gravatar_id":"","url":"https://api.github.com/users/mumuki","html_url":"https://github.com/mumuki","followers_url":"https://api.github.com/users/mumuki/followers","following_url":"https://api.github.com/users/mumuki/following{/other_user}","gists_url":"https://api.github.com/users/mumuki/gists{/gist_id}","starred_url":"https://api.github.com/users/mumuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumuki/subscriptions","organizations_url":"https://api.github.com/users/mumuki/orgs","repos_url":"https://api.github.com/users/mumuki/repos","events_url":"https://api.github.com/users/mumuki/events{/privacy}","received_events_url":"https://api.github.com/users/mumuki/received_events","type":"Organization","site_admin":false},"repo":{"id":44509699,"node_id":"MDEwOlJlcG9zaXRvcnk0NDUwOTY5OQ==","name":"mumuki-bibliotheca-api","full_name":"mumuki/mumuki-bibliotheca-api","private":false,"owner":{"login":"mumuki","id":10385254,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMzg1MjU0","avatar_url":"https://avatars2.githubusercontent.com/u/10385254?v=4","gravatar_id":"","url":"https://api.github.com/users/mumuki","html_url":"https://github.com/mumuki","followers_url":"https://api.github.com/users/mumuki/followers","following_url":"https://api.github.com/users/mumuki/following{/other_user}","gists_url":"https://api.github.com/users/mumuki/gists{/gist_id}","starred_url":"https://api.github.com/users/mumuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mumuki/subscriptions","organizations_url":"https://api.github.com/users/mumuki/orgs","repos_url":"https://api.github.com/users/mumuki/repos","events_url":"https://api.github.com/users/mumuki/events{/privacy}","received_events_url":"https://api.github.com/users/mumuki/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mumuki/mumuki-bibliotheca-api","description":"Storage and formatting API for Mumuki content","fork":false,"url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api","forks_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/forks","keys_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/teams","hooks_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/hooks","issue_events_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/events{/number}","events_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/events","assignees_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/assignees{/user}","branches_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/branches{/branch}","tags_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/tags","blobs_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/statuses/{sha}","languages_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/languages","stargazers_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/stargazers","contributors_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/contributors","subscribers_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/subscribers","subscription_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/subscription","commits_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/contents/{+path}","compare_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/merges","archive_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/downloads","issues_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues{/number}","pulls_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls{/number}","milestones_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/milestones{/number}","notifications_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/labels{/name}","releases_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/releases{/id}","deployments_url":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/deployments","created_at":"2015-10-19T03:42:42Z","updated_at":"2019-01-01T22:04:32Z","pushed_at":"2019-01-05T04:12:16Z","git_url":"git://github.com/mumuki/mumuki-bibliotheca-api.git","ssh_url":"git@github.com:mumuki/mumuki-bibliotheca-api.git","clone_url":"https://github.com/mumuki/mumuki-bibliotheca-api.git","svn_url":"https://github.com/mumuki/mumuki-bibliotheca-api","homepage":"","size":620,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":14,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140"},"html":{"href":"https://github.com/mumuki/mumuki-bibliotheca-api/pull/140"},"issue":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/140"},"comments":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/issues/140/comments"},"review_comments":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140/comments"},"review_comment":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/pulls/140/commits"},"statuses":{"href":"https://api.github.com/repos/mumuki/mumuki-bibliotheca-api/statuses/b1dc5f9dc3425768748436758419964497622778"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rodri042"}}