{"action":"created","issue":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/268","labels_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/268/comments","events_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/268/events","html_url":"https://github.com/cerebris/jsonapi-resources/issues/268","id":89712525,"number":268,"title":"ResourceSerializer#self_href doesn't generate correct links for mounted engines","user":{"login":"achan","id":549222,"avatar_url":"https://avatars.githubusercontent.com/u/549222?v=3","gravatar_id":"","url":"https://api.github.com/users/achan","html_url":"https://github.com/achan","followers_url":"https://api.github.com/users/achan/followers","following_url":"https://api.github.com/users/achan/following{/other_user}","gists_url":"https://api.github.com/users/achan/gists{/gist_id}","starred_url":"https://api.github.com/users/achan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achan/subscriptions","organizations_url":"https://api.github.com/users/achan/orgs","repos_url":"https://api.github.com/users/achan/repos","events_url":"https://api.github.com/users/achan/events{/privacy}","received_events_url":"https://api.github.com/users/achan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-20T04:03:19Z","updated_at":"2015-07-08T21:22:41Z","closed_at":null,"body":"When mounting an engine that uses `jsonapi-resources` to a custom folder like so:\r\n\r\n```ruby\r\nRails.application.routes.draw do\r\n  mount Basechurch::Engine => \"/api\"\r\nend\r\n```\r\n\r\nAll my links are not taking into account the custom folder when generated.\r\n\r\nWhen hitting the following endpoint:\r\n\r\n`GET http://example.com/api/v1/bulletins/2`\r\n\r\nMy response looks like so:\r\n\r\n```json\r\n{\r\n    \"data\": {\r\n        \"id\": \"2\",\r\n        \"type\": \"bulletins\",\r\n        \"links\": {\r\n            \"self\": \"http://example.com/basechurch/v1/bulletins/2\"\r\n        }\r\n        ...\r\n    }\r\n}\r\n```\r\n\r\nI'm pretty sure the issue is that the `ResourceSerializer` doesn't take into account mountable paths when formatting module names in resource class names: https://github.com/cerebris/jsonapi-resources/blob/4e46ed00606440f7136b041a6ead4c8353bc4a4b/lib/jsonapi/resource_serializer.rb#L215. Is this out of scope for the `ResourceSerializer`? Should I create a `MountedEngineResourceSerializer` for myself?"},"comment":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/comments/119734396","html_url":"https://github.com/cerebris/jsonapi-resources/issues/268#issuecomment-119734396","issue_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/268","id":119734396,"user":{"login":"thewatts","id":1141717,"avatar_url":"https://avatars.githubusercontent.com/u/1141717?v=3","gravatar_id":"","url":"https://api.github.com/users/thewatts","html_url":"https://github.com/thewatts","followers_url":"https://api.github.com/users/thewatts/followers","following_url":"https://api.github.com/users/thewatts/following{/other_user}","gists_url":"https://api.github.com/users/thewatts/gists{/gist_id}","starred_url":"https://api.github.com/users/thewatts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thewatts/subscriptions","organizations_url":"https://api.github.com/users/thewatts/orgs","repos_url":"https://api.github.com/users/thewatts/repos","events_url":"https://api.github.com/users/thewatts/events{/privacy}","received_events_url":"https://api.github.com/users/thewatts/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T21:22:41Z","updated_at":"2015-07-08T21:22:41Z","body":"@lgebhardt && @achan --> opened a WIP Pull Request (needs tests and a refactor).\r\n\r\n@achan would love to know if this works on your end (functionality is there - at least, when I tested locally with my own engine)."}}