{"action":"closed","number":60,"pull_request":{"url":"https://api.github.com/repos/cookpad/garage/pulls/60","id":69314823,"html_url":"https://github.com/cookpad/garage/pull/60","diff_url":"https://github.com/cookpad/garage/pull/60.diff","patch_url":"https://github.com/cookpad/garage/pull/60.patch","issue_url":"https://api.github.com/repos/cookpad/garage/issues/60","number":60,"state":"closed","locked":false,"title":"Fully support the \"presentation layer design\"","user":{"login":"taiki45","id":1460043,"avatar_url":"https://avatars.githubusercontent.com/u/1460043?v=3","gravatar_id":"","url":"https://api.github.com/users/taiki45","html_url":"https://github.com/taiki45","followers_url":"https://api.github.com/users/taiki45/followers","following_url":"https://api.github.com/users/taiki45/following{/other_user}","gists_url":"https://api.github.com/users/taiki45/gists{/gist_id}","starred_url":"https://api.github.com/users/taiki45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taiki45/subscriptions","organizations_url":"https://api.github.com/users/taiki45/orgs","repos_url":"https://api.github.com/users/taiki45/repos","events_url":"https://api.github.com/users/taiki45/events{/privacy}","received_events_url":"https://api.github.com/users/taiki45/received_events","type":"User","site_admin":false},"body":"Convert to resource before checking permissions.\r\n\r\nWe often create a presentation layer to define Garage resource\r\ndefinition instead of defining resource definition in the AR model\r\ndirectly. In that case, Garage automatically converts AR models\r\nto resource objects by calling `to_resource` method on them, but Garage\r\ndoes not convert AR models to resource objects on checking permissions.\r\nBy this change, patching Garage's RestfulActions or converting to\r\nresource object by hand become unnecessary.","created_at":"2016-05-09T09:06:07Z","updated_at":"2016-05-11T07:36:23Z","closed_at":"2016-05-11T07:36:23Z","merged_at":"2016-05-11T07:36:23Z","merge_commit_sha":"cdfe17d380a893ae10b3dabead573864702e3a35","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cookpad/garage/pulls/60/commits","review_comments_url":"https://api.github.com/repos/cookpad/garage/pulls/60/comments","review_comment_url":"https://api.github.com/repos/cookpad/garage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cookpad/garage/issues/60/comments","statuses_url":"https://api.github.com/repos/cookpad/garage/statuses/55e37b31fbf86e9a233898a642b46b27c09b20d2","head":{"label":"taiki45:convert-to-resource-before-checking-permissions","ref":"convert-to-resource-before-checking-permissions","sha":"55e37b31fbf86e9a233898a642b46b27c09b20d2","user":{"login":"taiki45","id":1460043,"avatar_url":"https://avatars.githubusercontent.com/u/1460043?v=3","gravatar_id":"","url":"https://api.github.com/users/taiki45","html_url":"https://github.com/taiki45","followers_url":"https://api.github.com/users/taiki45/followers","following_url":"https://api.github.com/users/taiki45/following{/other_user}","gists_url":"https://api.github.com/users/taiki45/gists{/gist_id}","starred_url":"https://api.github.com/users/taiki45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taiki45/subscriptions","organizations_url":"https://api.github.com/users/taiki45/orgs","repos_url":"https://api.github.com/users/taiki45/repos","events_url":"https://api.github.com/users/taiki45/events{/privacy}","received_events_url":"https://api.github.com/users/taiki45/received_events","type":"User","site_admin":false},"repo":{"id":24968729,"name":"garage","full_name":"taiki45/garage","owner":{"login":"taiki45","id":1460043,"avatar_url":"https://avatars.githubusercontent.com/u/1460043?v=3","gravatar_id":"","url":"https://api.github.com/users/taiki45","html_url":"https://github.com/taiki45","followers_url":"https://api.github.com/users/taiki45/followers","following_url":"https://api.github.com/users/taiki45/following{/other_user}","gists_url":"https://api.github.com/users/taiki45/gists{/gist_id}","starred_url":"https://api.github.com/users/taiki45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taiki45/subscriptions","organizations_url":"https://api.github.com/users/taiki45/orgs","repos_url":"https://api.github.com/users/taiki45/repos","events_url":"https://api.github.com/users/taiki45/events{/privacy}","received_events_url":"https://api.github.com/users/taiki45/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/taiki45/garage","description":"Rails extension for RESTful Hypermedia API","fork":true,"url":"https://api.github.com/repos/taiki45/garage","forks_url":"https://api.github.com/repos/taiki45/garage/forks","keys_url":"https://api.github.com/repos/taiki45/garage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taiki45/garage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taiki45/garage/teams","hooks_url":"https://api.github.com/repos/taiki45/garage/hooks","issue_events_url":"https://api.github.com/repos/taiki45/garage/issues/events{/number}","events_url":"https://api.github.com/repos/taiki45/garage/events","assignees_url":"https://api.github.com/repos/taiki45/garage/assignees{/user}","branches_url":"https://api.github.com/repos/taiki45/garage/branches{/branch}","tags_url":"https://api.github.com/repos/taiki45/garage/tags","blobs_url":"https://api.github.com/repos/taiki45/garage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taiki45/garage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taiki45/garage/git/refs{/sha}","trees_url":"https://api.github.com/repos/taiki45/garage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taiki45/garage/statuses/{sha}","languages_url":"https://api.github.com/repos/taiki45/garage/languages","stargazers_url":"https://api.github.com/repos/taiki45/garage/stargazers","contributors_url":"https://api.github.com/repos/taiki45/garage/contributors","subscribers_url":"https://api.github.com/repos/taiki45/garage/subscribers","subscription_url":"https://api.github.com/repos/taiki45/garage/subscription","commits_url":"https://api.github.com/repos/taiki45/garage/commits{/sha}","git_commits_url":"https://api.github.com/repos/taiki45/garage/git/commits{/sha}","comments_url":"https://api.github.com/repos/taiki45/garage/comments{/number}","issue_comment_url":"https://api.github.com/repos/taiki45/garage/issues/comments{/number}","contents_url":"https://api.github.com/repos/taiki45/garage/contents/{+path}","compare_url":"https://api.github.com/repos/taiki45/garage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taiki45/garage/merges","archive_url":"https://api.github.com/repos/taiki45/garage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taiki45/garage/downloads","issues_url":"https://api.github.com/repos/taiki45/garage/issues{/number}","pulls_url":"https://api.github.com/repos/taiki45/garage/pulls{/number}","milestones_url":"https://api.github.com/repos/taiki45/garage/milestones{/number}","notifications_url":"https://api.github.com/repos/taiki45/garage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taiki45/garage/labels{/name}","releases_url":"https://api.github.com/repos/taiki45/garage/releases{/id}","deployments_url":"https://api.github.com/repos/taiki45/garage/deployments","created_at":"2014-10-09T01:37:53Z","updated_at":"2015-04-23T09:59:48Z","pushed_at":"2016-05-11T00:56:20Z","git_url":"git://github.com/taiki45/garage.git","ssh_url":"git@github.com:taiki45/garage.git","clone_url":"https://github.com/taiki45/garage.git","svn_url":"https://github.com/taiki45/garage","homepage":"","size":481,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cookpad:master","ref":"master","sha":"de996aa5b2b2640dc2de90deaec791ca7bd9cf82","user":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"repo":{"id":24125601,"name":"garage","full_name":"cookpad/garage","owner":{"login":"cookpad","id":119195,"avatar_url":"https://avatars.githubusercontent.com/u/119195?v=3","gravatar_id":"","url":"https://api.github.com/users/cookpad","html_url":"https://github.com/cookpad","followers_url":"https://api.github.com/users/cookpad/followers","following_url":"https://api.github.com/users/cookpad/following{/other_user}","gists_url":"https://api.github.com/users/cookpad/gists{/gist_id}","starred_url":"https://api.github.com/users/cookpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cookpad/subscriptions","organizations_url":"https://api.github.com/users/cookpad/orgs","repos_url":"https://api.github.com/users/cookpad/repos","events_url":"https://api.github.com/users/cookpad/events{/privacy}","received_events_url":"https://api.github.com/users/cookpad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cookpad/garage","description":"Rails extension for RESTful Hypermedia API","fork":false,"url":"https://api.github.com/repos/cookpad/garage","forks_url":"https://api.github.com/repos/cookpad/garage/forks","keys_url":"https://api.github.com/repos/cookpad/garage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cookpad/garage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cookpad/garage/teams","hooks_url":"https://api.github.com/repos/cookpad/garage/hooks","issue_events_url":"https://api.github.com/repos/cookpad/garage/issues/events{/number}","events_url":"https://api.github.com/repos/cookpad/garage/events","assignees_url":"https://api.github.com/repos/cookpad/garage/assignees{/user}","branches_url":"https://api.github.com/repos/cookpad/garage/branches{/branch}","tags_url":"https://api.github.com/repos/cookpad/garage/tags","blobs_url":"https://api.github.com/repos/cookpad/garage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cookpad/garage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cookpad/garage/git/refs{/sha}","trees_url":"https://api.github.com/repos/cookpad/garage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cookpad/garage/statuses/{sha}","languages_url":"https://api.github.com/repos/cookpad/garage/languages","stargazers_url":"https://api.github.com/repos/cookpad/garage/stargazers","contributors_url":"https://api.github.com/repos/cookpad/garage/contributors","subscribers_url":"https://api.github.com/repos/cookpad/garage/subscribers","subscription_url":"https://api.github.com/repos/cookpad/garage/subscription","commits_url":"https://api.github.com/repos/cookpad/garage/commits{/sha}","git_commits_url":"https://api.github.com/repos/cookpad/garage/git/commits{/sha}","comments_url":"https://api.github.com/repos/cookpad/garage/comments{/number}","issue_comment_url":"https://api.github.com/repos/cookpad/garage/issues/comments{/number}","contents_url":"https://api.github.com/repos/cookpad/garage/contents/{+path}","compare_url":"https://api.github.com/repos/cookpad/garage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cookpad/garage/merges","archive_url":"https://api.github.com/repos/cookpad/garage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cookpad/garage/downloads","issues_url":"https://api.github.com/repos/cookpad/garage/issues{/number}","pulls_url":"https://api.github.com/repos/cookpad/garage/pulls{/number}","milestones_url":"https://api.github.com/repos/cookpad/garage/milestones{/number}","notifications_url":"https://api.github.com/repos/cookpad/garage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cookpad/garage/labels{/name}","releases_url":"https://api.github.com/repos/cookpad/garage/releases{/id}","deployments_url":"https://api.github.com/repos/cookpad/garage/deployments","created_at":"2014-09-17T01:55:13Z","updated_at":"2016-05-10T17:27:45Z","pushed_at":"2016-05-11T07:36:23Z","git_url":"git://github.com/cookpad/garage.git","ssh_url":"git@github.com:cookpad/garage.git","clone_url":"https://github.com/cookpad/garage.git","svn_url":"https://github.com/cookpad/garage","homepage":"","size":512,"stargazers_count":401,"watchers_count":401,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":2,"forks":27,"open_issues":2,"watchers":401,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cookpad/garage/pulls/60"},"html":{"href":"https://github.com/cookpad/garage/pull/60"},"issue":{"href":"https://api.github.com/repos/cookpad/garage/issues/60"},"comments":{"href":"https://api.github.com/repos/cookpad/garage/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/cookpad/garage/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/cookpad/garage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cookpad/garage/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/cookpad/garage/statuses/55e37b31fbf86e9a233898a642b46b27c09b20d2"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"taiki45","id":1460043,"avatar_url":"https://avatars.githubusercontent.com/u/1460043?v=3","gravatar_id":"","url":"https://api.github.com/users/taiki45","html_url":"https://github.com/taiki45","followers_url":"https://api.github.com/users/taiki45/followers","following_url":"https://api.github.com/users/taiki45/following{/other_user}","gists_url":"https://api.github.com/users/taiki45/gists{/gist_id}","starred_url":"https://api.github.com/users/taiki45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taiki45/subscriptions","organizations_url":"https://api.github.com/users/taiki45/orgs","repos_url":"https://api.github.com/users/taiki45/repos","events_url":"https://api.github.com/users/taiki45/events{/privacy}","received_events_url":"https://api.github.com/users/taiki45/received_events","type":"User","site_admin":false},"comments":2,"review_comments":5,"commits":3,"additions":145,"deletions":11,"changed_files":11}}