{"action":"created","issue":{"url":"https://api.github.com/repos/rails/globalid/issues/59","labels_url":"https://api.github.com/repos/rails/globalid/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/rails/globalid/issues/59/comments","events_url":"https://api.github.com/repos/rails/globalid/issues/59/events","html_url":"https://github.com/rails/globalid/issues/59","id":54870404,"number":59,"title":"suggestion - class method to create globalid from values","user":{"login":"antulik","id":831942,"avatar_url":"https://avatars.githubusercontent.com/u/831942?v=3","gravatar_id":"","url":"https://api.github.com/users/antulik","html_url":"https://github.com/antulik","followers_url":"https://api.github.com/users/antulik/followers","following_url":"https://api.github.com/users/antulik/following{/other_user}","gists_url":"https://api.github.com/users/antulik/gists{/gist_id}","starred_url":"https://api.github.com/users/antulik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antulik/subscriptions","organizations_url":"https://api.github.com/users/antulik/orgs","repos_url":"https://api.github.com/users/antulik/repos","events_url":"https://api.github.com/users/antulik/events{/privacy}","received_events_url":"https://api.github.com/users/antulik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-20T11:09:42Z","updated_at":"2015-02-23T17:58:39Z","closed_at":null,"body":"Would like to suggest to add class method like `GlobalID.create` but where you can pass `model_class` and `model_id` directly. \r\n\r\nThis is helpful when you need to create GlobalID without object, for example in polymorphic associations where you have two columns with `class` and `id` (like owner_type and owner_id)\r\n\r\nfor example\r\n\r\n```ruby\r\nGlobalID.create('User', 4, options)\r\n```\r\n\r\nalternatively currently we have to do \r\n\r\n```ruby\r\nUser.new(id: 4).to_global_id\r\n```\r\n\r\nwhich results in unnecessary object creation"},"comment":{"url":"https://api.github.com/repos/rails/globalid/issues/comments/75595489","html_url":"https://github.com/rails/globalid/issues/59#issuecomment-75595489","issue_url":"https://api.github.com/repos/rails/globalid/issues/59","id":75595489,"user":{"login":"kaspth","id":350807,"avatar_url":"https://avatars.githubusercontent.com/u/350807?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspth","html_url":"https://github.com/kaspth","followers_url":"https://api.github.com/users/kaspth/followers","following_url":"https://api.github.com/users/kaspth/following{/other_user}","gists_url":"https://api.github.com/users/kaspth/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspth/subscriptions","organizations_url":"https://api.github.com/users/kaspth/orgs","repos_url":"https://api.github.com/users/kaspth/repos","events_url":"https://api.github.com/users/kaspth/events{/privacy}","received_events_url":"https://api.github.com/users/kaspth/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T17:58:39Z","updated_at":"2015-02-23T17:58:39Z","body":"The only way to implement `company_global_id` is with `method_missing`. I'd love to avoid that in our `GlobalID::Identification` mixin.\r\n\r\nBesides `method_missing` would have to check four different call types: `company_global_id`, `company_gid`, `company_signed_global_id` and `company_sgid`.\r\n\r\nBut honestly, I'm not sure which way to go. @dhh do you have any preference here?"}}