{"action":"created","issue":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3170","labels_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3170/labels{/name}","comments_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3170/comments","events_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3170/events","html_url":"https://github.com/activeadmin/activeadmin/pull/3170","id":34277828,"number":3170,"title":"Router rewrite and support of singleton belongs to resources","user":{"login":"dmitry","id":5091,"avatar_url":"https://avatars.githubusercontent.com/u/5091?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry","html_url":"https://github.com/dmitry","followers_url":"https://api.github.com/users/dmitry/followers","following_url":"https://api.github.com/users/dmitry/following{/other_user}","gists_url":"https://api.github.com/users/dmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry/subscriptions","organizations_url":"https://api.github.com/users/dmitry/orgs","repos_url":"https://api.github.com/users/dmitry/repos","events_url":"https://api.github.com/users/dmitry/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/activeadmin/activeadmin/labels/4%20-%20Review","name":"4 - Review","color":"d4c5f9"},{"url":"https://api.github.com/repos/activeadmin/activeadmin/labels/Routing","name":"Routing","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":39,"created_at":"2014-05-26T01:59:24Z","updated_at":"2015-02-20T13:30:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/activeadmin/activeadmin/pulls/3170","html_url":"https://github.com/activeadmin/activeadmin/pull/3170","diff_url":"https://github.com/activeadmin/activeadmin/pull/3170.diff","patch_url":"https://github.com/activeadmin/activeadmin/pull/3170.patch"},"body":"It's WIP branch, which will be squashed and completed, after you give me a green light on it.\r\n\r\n- [x] Rewrite of the router definitions\r\n- [x] Add`s ability to define singleton resource\r\n\r\n#### Related\r\n\r\n- Support multiple belongs_to (https://github.com/gregbell/active_admin/issues/221)\r\n- Support nested belongs_to (#3280)\r\n\r\n#### Singleton resource\r\n\r\n```ruby\r\nActiveAdmin.register Place\r\nActiveAdmin.register Location do\r\n  belongs_to :place, singleton: true\r\nend\r\n```\r\n\r\nGenerates correct route with `resource` DSL command, instead of `resources`, so it's possible to get access location using the url: `/admin/users/1/location` instead of `/admin/users/1/locations`."},"comment":{"url":"https://api.github.com/repos/activeadmin/activeadmin/issues/comments/75237824","html_url":"https://github.com/activeadmin/activeadmin/pull/3170#issuecomment-75237824","issue_url":"https://api.github.com/repos/activeadmin/activeadmin/issues/3170","id":75237824,"user":{"login":"bamorim","id":828081,"avatar_url":"https://avatars.githubusercontent.com/u/828081?v=3","gravatar_id":"","url":"https://api.github.com/users/bamorim","html_url":"https://github.com/bamorim","followers_url":"https://api.github.com/users/bamorim/followers","following_url":"https://api.github.com/users/bamorim/following{/other_user}","gists_url":"https://api.github.com/users/bamorim/gists{/gist_id}","starred_url":"https://api.github.com/users/bamorim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bamorim/subscriptions","organizations_url":"https://api.github.com/users/bamorim/orgs","repos_url":"https://api.github.com/users/bamorim/repos","events_url":"https://api.github.com/users/bamorim/events{/privacy}","received_events_url":"https://api.github.com/users/bamorim/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T13:30:51Z","updated_at":"2015-02-20T13:30:51Z","body":"I'll try to handle this soon if I finish my week tasks on my job.\r\n\r\nHowever, what refactoring you think should be applied?\r\n\r\nI'm thinking about an elegant way to do this and #3280. I'll first finish this and then I'd copy my tests and rewrite it and update my PR.\r\nSuggestions are welcome."}}