{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/27291","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/27291/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/27291/comments","events_url":"https://api.github.com/repos/rails/rails/issues/27291/events","html_url":"https://github.com/rails/rails/pull/27291","id":193956724,"number":27291,"title":"support callable in `routes.default_url_options`","user":{"login":"ignatiusreza","id":667726,"avatar_url":"https://avatars.githubusercontent.com/u/667726?v=3","gravatar_id":"","url":"https://api.github.com/users/ignatiusreza","html_url":"https://github.com/ignatiusreza","followers_url":"https://api.github.com/users/ignatiusreza/followers","following_url":"https://api.github.com/users/ignatiusreza/following{/other_user}","gists_url":"https://api.github.com/users/ignatiusreza/gists{/gist_id}","starred_url":"https://api.github.com/users/ignatiusreza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignatiusreza/subscriptions","organizations_url":"https://api.github.com/users/ignatiusreza/orgs","repos_url":"https://api.github.com/users/ignatiusreza/repos","events_url":"https://api.github.com/users/ignatiusreza/events{/privacy}","received_events_url":"https://api.github.com/users/ignatiusreza/received_events","type":"User","site_admin":false},"labels":[{"id":107189,"url":"https://api.github.com/repos/rails/rails/labels/actionpack","name":"actionpack","color":"FFF700","default":false}],"state":"closed","locked":false,"assignee":{"login":"eileencodes","id":1080678,"avatar_url":"https://avatars.githubusercontent.com/u/1080678?v=3","gravatar_id":"","url":"https://api.github.com/users/eileencodes","html_url":"https://github.com/eileencodes","followers_url":"https://api.github.com/users/eileencodes/followers","following_url":"https://api.github.com/users/eileencodes/following{/other_user}","gists_url":"https://api.github.com/users/eileencodes/gists{/gist_id}","starred_url":"https://api.github.com/users/eileencodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileencodes/subscriptions","organizations_url":"https://api.github.com/users/eileencodes/orgs","repos_url":"https://api.github.com/users/eileencodes/repos","events_url":"https://api.github.com/users/eileencodes/events{/privacy}","received_events_url":"https://api.github.com/users/eileencodes/received_events","type":"User","site_admin":false},"assignees":[{"login":"eileencodes","id":1080678,"avatar_url":"https://avatars.githubusercontent.com/u/1080678?v=3","gravatar_id":"","url":"https://api.github.com/users/eileencodes","html_url":"https://github.com/eileencodes","followers_url":"https://api.github.com/users/eileencodes/followers","following_url":"https://api.github.com/users/eileencodes/following{/other_user}","gists_url":"https://api.github.com/users/eileencodes/gists{/gist_id}","starred_url":"https://api.github.com/users/eileencodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileencodes/subscriptions","organizations_url":"https://api.github.com/users/eileencodes/orgs","repos_url":"https://api.github.com/users/eileencodes/repos","events_url":"https://api.github.com/users/eileencodes/events{/privacy}","received_events_url":"https://api.github.com/users/eileencodes/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2016-12-07T04:40:28Z","updated_at":"2016-12-09T10:51:31Z","closed_at":"2016-12-08T18:01:46Z","pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/27291","html_url":"https://github.com/rails/rails/pull/27291","diff_url":"https://github.com/rails/rails/pull/27291.diff","patch_url":"https://github.com/rails/rails/pull/27291.patch"},"body":"to be used when we want to have defaults that are lazily evaluated.\r\n\r\nfor example, when we want to have `I18n.locale` as part as the path, and we want it to reflect the locale that currently is active when the url is generated\r\n\r\n`#default_url_options` in controller solve cases when we're generating the url in controller and views, but it doesn't handle cases when `Rails.application.routes.url_helpers` are included in other classes, which this commit address"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/265986452","html_url":"https://github.com/rails/rails/pull/27291#issuecomment-265986452","issue_url":"https://api.github.com/repos/rails/rails/issues/27291","id":265986452,"user":{"login":"ignatiusreza","id":667726,"avatar_url":"https://avatars.githubusercontent.com/u/667726?v=3","gravatar_id":"","url":"https://api.github.com/users/ignatiusreza","html_url":"https://github.com/ignatiusreza","followers_url":"https://api.github.com/users/ignatiusreza/followers","following_url":"https://api.github.com/users/ignatiusreza/following{/other_user}","gists_url":"https://api.github.com/users/ignatiusreza/gists{/gist_id}","starred_url":"https://api.github.com/users/ignatiusreza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignatiusreza/subscriptions","organizations_url":"https://api.github.com/users/ignatiusreza/orgs","repos_url":"https://api.github.com/users/ignatiusreza/repos","events_url":"https://api.github.com/users/ignatiusreza/events{/privacy}","received_events_url":"https://api.github.com/users/ignatiusreza/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T10:51:31Z","updated_at":"2016-12-09T10:51:31Z","body":"That's a valid point, and I agree that including url helpers in models is an anti-pattern..\r\n\r\nI came up with this feature request, because I had some difficulties not just in model, but also in tests.. I've setup a sample repo that consist of a new rails app with some scaffold sprinkled in with default_url_options in controller and a locale scoped routes.. which hopefully would demonstrate the issue that i'm talking about.. the repo can be found at https://github.com/ignatiusreza/rails-pr-27291/commits/master\r\n\r\nThis same issue also exists in tests written using rspec or cucumber.."}}
{"actor":{"display_login":"ignatiusreza"}}