{"action":"created","issue":{"url":"https://api.github.com/repos/theforeman/foreman/issues/2801","labels_url":"https://api.github.com/repos/theforeman/foreman/issues/2801/labels{/name}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2801/comments","events_url":"https://api.github.com/repos/theforeman/foreman/issues/2801/events","html_url":"https://github.com/theforeman/foreman/pull/2801","id":110465350,"number":2801,"title":"fixes #12109 -removing owner_id presence validation","user":{"login":"unorthodoxgeek","id":706359,"avatar_url":"https://avatars.githubusercontent.com/u/706359?v=3","gravatar_id":"","url":"https://api.github.com/users/unorthodoxgeek","html_url":"https://github.com/unorthodoxgeek","followers_url":"https://api.github.com/users/unorthodoxgeek/followers","following_url":"https://api.github.com/users/unorthodoxgeek/following{/other_user}","gists_url":"https://api.github.com/users/unorthodoxgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/unorthodoxgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unorthodoxgeek/subscriptions","organizations_url":"https://api.github.com/users/unorthodoxgeek/orgs","repos_url":"https://api.github.com/users/unorthodoxgeek/repos","events_url":"https://api.github.com/users/unorthodoxgeek/events{/privacy}","received_events_url":"https://api.github.com/users/unorthodoxgeek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/theforeman/foreman/labels/Needs%20re-review","name":"Needs re-review","color":"0052cc"},{"url":"https://api.github.com/repos/theforeman/foreman/labels/Needs%20testing","name":"Needs testing","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-10-08T14:35:54Z","updated_at":"2015-10-23T10:34:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2801","html_url":"https://github.com/theforeman/foreman/pull/2801","diff_url":"https://github.com/theforeman/foreman/pull/2801.diff","patch_url":"https://github.com/theforeman/foreman/pull/2801.patch"},"body":"in rails 4, owner is not populated when creating a join model\r\n(user.roles << role created a UserRole on the background)\r\nin rails 3, this is not a problem, in rails 4, the presence validation\r\nfails because no owner_id exists nor does an owner exist. at that\r\nmoment, there’s no need to do the uniqueness validation, as it’s the\r\nuser’s first roles. thus, this fix."},"comment":{"url":"https://api.github.com/repos/theforeman/foreman/issues/comments/150538898","html_url":"https://github.com/theforeman/foreman/pull/2801#issuecomment-150538898","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2801","id":150538898,"user":{"login":"dLobatog","id":598891,"avatar_url":"https://avatars.githubusercontent.com/u/598891?v=3","gravatar_id":"","url":"https://api.github.com/users/dLobatog","html_url":"https://github.com/dLobatog","followers_url":"https://api.github.com/users/dLobatog/followers","following_url":"https://api.github.com/users/dLobatog/following{/other_user}","gists_url":"https://api.github.com/users/dLobatog/gists{/gist_id}","starred_url":"https://api.github.com/users/dLobatog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dLobatog/subscriptions","organizations_url":"https://api.github.com/users/dLobatog/orgs","repos_url":"https://api.github.com/users/dLobatog/repos","events_url":"https://api.github.com/users/dLobatog/events{/privacy}","received_events_url":"https://api.github.com/users/dLobatog/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T10:34:24Z","updated_at":"2015-10-23T10:34:24Z","body":"Merged as aa19bc0cdacd2ca522d65b821465180641a52fa7, thanks @unorthodoxgeek! "}}