{"action":"created","issue":{"url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1717","labels_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1717/labels{/name}","comments_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1717/comments","events_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1717/events","html_url":"https://github.com/carrierwaveuploader/carrierwave/issues/1717","id":99720552,"number":1717,"title":"File storage: url and path (unexpected) behaviour","user":{"login":"mariusbutuc","id":511893,"avatar_url":"https://avatars.githubusercontent.com/u/511893?v=3","gravatar_id":"","url":"https://api.github.com/users/mariusbutuc","html_url":"https://github.com/mariusbutuc","followers_url":"https://api.github.com/users/mariusbutuc/followers","following_url":"https://api.github.com/users/mariusbutuc/following{/other_user}","gists_url":"https://api.github.com/users/mariusbutuc/gists{/gist_id}","starred_url":"https://api.github.com/users/mariusbutuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariusbutuc/subscriptions","organizations_url":"https://api.github.com/users/mariusbutuc/orgs","repos_url":"https://api.github.com/users/mariusbutuc/repos","events_url":"https://api.github.com/users/mariusbutuc/events{/privacy}","received_events_url":"https://api.github.com/users/mariusbutuc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-07T19:58:55Z","updated_at":"2015-08-24T20:06:58Z","closed_at":null,"body":"Running v0.10.0, and using `file` storage provides a surprising (to me) behaviour. The `url` and `path` methods on the uploaded image work the opposite compared to the expectation created when using `fog` for storage, or the Rails helper patterns:\r\n  - `url` returns the relative path, while\r\n  - `path` returns the absolute path.\r\n\r\nIs there a reason behind this, or is this a bug?"},"comment":{"url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/comments/134361248","html_url":"https://github.com/carrierwaveuploader/carrierwave/issues/1717#issuecomment-134361248","issue_url":"https://api.github.com/repos/carrierwaveuploader/carrierwave/issues/1717","id":134361248,"user":{"login":"mariusbutuc","id":511893,"avatar_url":"https://avatars.githubusercontent.com/u/511893?v=3","gravatar_id":"","url":"https://api.github.com/users/mariusbutuc","html_url":"https://github.com/mariusbutuc","followers_url":"https://api.github.com/users/mariusbutuc/followers","following_url":"https://api.github.com/users/mariusbutuc/following{/other_user}","gists_url":"https://api.github.com/users/mariusbutuc/gists{/gist_id}","starred_url":"https://api.github.com/users/mariusbutuc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariusbutuc/subscriptions","organizations_url":"https://api.github.com/users/mariusbutuc/orgs","repos_url":"https://api.github.com/users/mariusbutuc/repos","events_url":"https://api.github.com/users/mariusbutuc/events{/privacy}","received_events_url":"https://api.github.com/users/mariusbutuc/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T20:06:58Z","updated_at":"2015-08-24T20:06:58Z","body":"@eavgerinos using `fog` storage they behave as expected, but using `file` storage their behaviour is flipped. In an attempt to explain it better, here's the \"hack\" I'm relying on at the moment:\r\n```ruby\r\ndef artwork_url(image:)\r\n  image._storage.to_s.match('File') ? image.path : image.url\r\nend\r\n```\r\nDoes this help?"}}