{"action":"closed","number":657,"pull_request":{"url":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657","id":63269351,"html_url":"https://github.com/cerebris/jsonapi-resources/pull/657","diff_url":"https://github.com/cerebris/jsonapi-resources/pull/657.diff","patch_url":"https://github.com/cerebris/jsonapi-resources/pull/657.patch","issue_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/657","number":657,"state":"closed","locked":false,"title":"Accept nil data when updating polymorphic to_one relationship ","user":{"login":"Zooip","id":3407327,"avatar_url":"https://avatars.githubusercontent.com/u/3407327?v=3","gravatar_id":"","url":"https://api.github.com/users/Zooip","html_url":"https://github.com/Zooip","followers_url":"https://api.github.com/users/Zooip/followers","following_url":"https://api.github.com/users/Zooip/following{/other_user}","gists_url":"https://api.github.com/users/Zooip/gists{/gist_id}","starred_url":"https://api.github.com/users/Zooip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zooip/subscriptions","organizations_url":"https://api.github.com/users/Zooip/orgs","repos_url":"https://api.github.com/users/Zooip/repos","events_url":"https://api.github.com/users/Zooip/events{/privacy}","received_events_url":"https://api.github.com/users/Zooip/received_events","type":"User","site_admin":false},"body":"Related to #656\r\nEnsure that `verified_params[:to_one].values[0]` is present before calling `[:id]` and `[:type]`\r\n\r\nThis way the following request clear the polymorphic relationship in the same way as a non-polymorphic relationship.\r\n\r\n```\r\nPATCH /articles/1/relationships/author HTTP/1.1\r\nContent-Type: application/vnd.api+json\r\nAccept: application/vnd.api+json\r\n\r\n{\r\n  \"data\": null\r\n}\r\n```\r\n\r\nWasn't able to create a test case using defined test model since there is no to_one retaltionship.","created_at":"2016-03-17T18:20:52Z","updated_at":"2016-04-29T15:58:34Z","closed_at":"2016-04-29T15:58:34Z","merged_at":"2016-04-29T15:58:34Z","merge_commit_sha":"4f3720586537a450437f74653a07a2da2d519e63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657/commits","review_comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657/comments","review_comment_url":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/657/comments","statuses_url":"https://api.github.com/repos/cerebris/jsonapi-resources/statuses/5857dd9d054d6028c56fd2b6f2e3aa653e95be9e","head":{"label":"Zooip:fix_nil_data_on_polymorphic_to_one_relationship","ref":"fix_nil_data_on_polymorphic_to_one_relationship","sha":"5857dd9d054d6028c56fd2b6f2e3aa653e95be9e","user":{"login":"Zooip","id":3407327,"avatar_url":"https://avatars.githubusercontent.com/u/3407327?v=3","gravatar_id":"","url":"https://api.github.com/users/Zooip","html_url":"https://github.com/Zooip","followers_url":"https://api.github.com/users/Zooip/followers","following_url":"https://api.github.com/users/Zooip/following{/other_user}","gists_url":"https://api.github.com/users/Zooip/gists{/gist_id}","starred_url":"https://api.github.com/users/Zooip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zooip/subscriptions","organizations_url":"https://api.github.com/users/Zooip/orgs","repos_url":"https://api.github.com/users/Zooip/repos","events_url":"https://api.github.com/users/Zooip/events{/privacy}","received_events_url":"https://api.github.com/users/Zooip/received_events","type":"User","site_admin":false},"repo":{"id":54132280,"name":"jsonapi-resources","full_name":"Zooip/jsonapi-resources","owner":{"login":"Zooip","id":3407327,"avatar_url":"https://avatars.githubusercontent.com/u/3407327?v=3","gravatar_id":"","url":"https://api.github.com/users/Zooip","html_url":"https://github.com/Zooip","followers_url":"https://api.github.com/users/Zooip/followers","following_url":"https://api.github.com/users/Zooip/following{/other_user}","gists_url":"https://api.github.com/users/Zooip/gists{/gist_id}","starred_url":"https://api.github.com/users/Zooip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zooip/subscriptions","organizations_url":"https://api.github.com/users/Zooip/orgs","repos_url":"https://api.github.com/users/Zooip/repos","events_url":"https://api.github.com/users/Zooip/events{/privacy}","received_events_url":"https://api.github.com/users/Zooip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zooip/jsonapi-resources","description":"A resource-focused Rails library for developing JSON API compliant servers.","fork":true,"url":"https://api.github.com/repos/Zooip/jsonapi-resources","forks_url":"https://api.github.com/repos/Zooip/jsonapi-resources/forks","keys_url":"https://api.github.com/repos/Zooip/jsonapi-resources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zooip/jsonapi-resources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zooip/jsonapi-resources/teams","hooks_url":"https://api.github.com/repos/Zooip/jsonapi-resources/hooks","issue_events_url":"https://api.github.com/repos/Zooip/jsonapi-resources/issues/events{/number}","events_url":"https://api.github.com/repos/Zooip/jsonapi-resources/events","assignees_url":"https://api.github.com/repos/Zooip/jsonapi-resources/assignees{/user}","branches_url":"https://api.github.com/repos/Zooip/jsonapi-resources/branches{/branch}","tags_url":"https://api.github.com/repos/Zooip/jsonapi-resources/tags","blobs_url":"https://api.github.com/repos/Zooip/jsonapi-resources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zooip/jsonapi-resources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zooip/jsonapi-resources/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zooip/jsonapi-resources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zooip/jsonapi-resources/statuses/{sha}","languages_url":"https://api.github.com/repos/Zooip/jsonapi-resources/languages","stargazers_url":"https://api.github.com/repos/Zooip/jsonapi-resources/stargazers","contributors_url":"https://api.github.com/repos/Zooip/jsonapi-resources/contributors","subscribers_url":"https://api.github.com/repos/Zooip/jsonapi-resources/subscribers","subscription_url":"https://api.github.com/repos/Zooip/jsonapi-resources/subscription","commits_url":"https://api.github.com/repos/Zooip/jsonapi-resources/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zooip/jsonapi-resources/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zooip/jsonapi-resources/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zooip/jsonapi-resources/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zooip/jsonapi-resources/contents/{+path}","compare_url":"https://api.github.com/repos/Zooip/jsonapi-resources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zooip/jsonapi-resources/merges","archive_url":"https://api.github.com/repos/Zooip/jsonapi-resources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zooip/jsonapi-resources/downloads","issues_url":"https://api.github.com/repos/Zooip/jsonapi-resources/issues{/number}","pulls_url":"https://api.github.com/repos/Zooip/jsonapi-resources/pulls{/number}","milestones_url":"https://api.github.com/repos/Zooip/jsonapi-resources/milestones{/number}","notifications_url":"https://api.github.com/repos/Zooip/jsonapi-resources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zooip/jsonapi-resources/labels{/name}","releases_url":"https://api.github.com/repos/Zooip/jsonapi-resources/releases{/id}","deployments_url":"https://api.github.com/repos/Zooip/jsonapi-resources/deployments","created_at":"2016-03-17T16:06:20Z","updated_at":"2016-03-17T16:06:21Z","pushed_at":"2016-03-17T18:05:33Z","git_url":"git://github.com/Zooip/jsonapi-resources.git","ssh_url":"git@github.com:Zooip/jsonapi-resources.git","clone_url":"https://github.com/Zooip/jsonapi-resources.git","svn_url":"https://github.com/Zooip/jsonapi-resources","homepage":"","size":1904,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cerebris:master","ref":"master","sha":"d298a4060c8906683a4d61ce1ac698bf3cbacd8b","user":{"login":"cerebris","id":326811,"avatar_url":"https://avatars.githubusercontent.com/u/326811?v=3","gravatar_id":"","url":"https://api.github.com/users/cerebris","html_url":"https://github.com/cerebris","followers_url":"https://api.github.com/users/cerebris/followers","following_url":"https://api.github.com/users/cerebris/following{/other_user}","gists_url":"https://api.github.com/users/cerebris/gists{/gist_id}","starred_url":"https://api.github.com/users/cerebris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerebris/subscriptions","organizations_url":"https://api.github.com/users/cerebris/orgs","repos_url":"https://api.github.com/users/cerebris/repos","events_url":"https://api.github.com/users/cerebris/events{/privacy}","received_events_url":"https://api.github.com/users/cerebris/received_events","type":"Organization","site_admin":false},"repo":{"id":18248068,"name":"jsonapi-resources","full_name":"cerebris/jsonapi-resources","owner":{"login":"cerebris","id":326811,"avatar_url":"https://avatars.githubusercontent.com/u/326811?v=3","gravatar_id":"","url":"https://api.github.com/users/cerebris","html_url":"https://github.com/cerebris","followers_url":"https://api.github.com/users/cerebris/followers","following_url":"https://api.github.com/users/cerebris/following{/other_user}","gists_url":"https://api.github.com/users/cerebris/gists{/gist_id}","starred_url":"https://api.github.com/users/cerebris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerebris/subscriptions","organizations_url":"https://api.github.com/users/cerebris/orgs","repos_url":"https://api.github.com/users/cerebris/repos","events_url":"https://api.github.com/users/cerebris/events{/privacy}","received_events_url":"https://api.github.com/users/cerebris/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cerebris/jsonapi-resources","description":"A resource-focused Rails library for developing JSON API compliant servers.","fork":false,"url":"https://api.github.com/repos/cerebris/jsonapi-resources","forks_url":"https://api.github.com/repos/cerebris/jsonapi-resources/forks","keys_url":"https://api.github.com/repos/cerebris/jsonapi-resources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cerebris/jsonapi-resources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cerebris/jsonapi-resources/teams","hooks_url":"https://api.github.com/repos/cerebris/jsonapi-resources/hooks","issue_events_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/events{/number}","events_url":"https://api.github.com/repos/cerebris/jsonapi-resources/events","assignees_url":"https://api.github.com/repos/cerebris/jsonapi-resources/assignees{/user}","branches_url":"https://api.github.com/repos/cerebris/jsonapi-resources/branches{/branch}","tags_url":"https://api.github.com/repos/cerebris/jsonapi-resources/tags","blobs_url":"https://api.github.com/repos/cerebris/jsonapi-resources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cerebris/jsonapi-resources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cerebris/jsonapi-resources/git/refs{/sha}","trees_url":"https://api.github.com/repos/cerebris/jsonapi-resources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cerebris/jsonapi-resources/statuses/{sha}","languages_url":"https://api.github.com/repos/cerebris/jsonapi-resources/languages","stargazers_url":"https://api.github.com/repos/cerebris/jsonapi-resources/stargazers","contributors_url":"https://api.github.com/repos/cerebris/jsonapi-resources/contributors","subscribers_url":"https://api.github.com/repos/cerebris/jsonapi-resources/subscribers","subscription_url":"https://api.github.com/repos/cerebris/jsonapi-resources/subscription","commits_url":"https://api.github.com/repos/cerebris/jsonapi-resources/commits{/sha}","git_commits_url":"https://api.github.com/repos/cerebris/jsonapi-resources/git/commits{/sha}","comments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/comments{/number}","issue_comment_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/comments{/number}","contents_url":"https://api.github.com/repos/cerebris/jsonapi-resources/contents/{+path}","compare_url":"https://api.github.com/repos/cerebris/jsonapi-resources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cerebris/jsonapi-resources/merges","archive_url":"https://api.github.com/repos/cerebris/jsonapi-resources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cerebris/jsonapi-resources/downloads","issues_url":"https://api.github.com/repos/cerebris/jsonapi-resources/issues{/number}","pulls_url":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls{/number}","milestones_url":"https://api.github.com/repos/cerebris/jsonapi-resources/milestones{/number}","notifications_url":"https://api.github.com/repos/cerebris/jsonapi-resources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cerebris/jsonapi-resources/labels{/name}","releases_url":"https://api.github.com/repos/cerebris/jsonapi-resources/releases{/id}","deployments_url":"https://api.github.com/repos/cerebris/jsonapi-resources/deployments","created_at":"2014-03-29T18:45:23Z","updated_at":"2016-04-29T15:02:57Z","pushed_at":"2016-04-29T15:58:34Z","git_url":"git://github.com/cerebris/jsonapi-resources.git","ssh_url":"git@github.com:cerebris/jsonapi-resources.git","clone_url":"https://github.com/cerebris/jsonapi-resources.git","svn_url":"https://github.com/cerebris/jsonapi-resources","homepage":"","size":2379,"stargazers_count":1193,"watchers_count":1193,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":221,"mirror_url":null,"open_issues_count":165,"forks":221,"open_issues":165,"watchers":1193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657"},"html":{"href":"https://github.com/cerebris/jsonapi-resources/pull/657"},"issue":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/657"},"comments":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/issues/657/comments"},"review_comments":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657/comments"},"review_comment":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/pulls/657/commits"},"statuses":{"href":"https://api.github.com/repos/cerebris/jsonapi-resources/statuses/5857dd9d054d6028c56fd2b6f2e3aa653e95be9e"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"lgebhardt","id":29154,"avatar_url":"https://avatars.githubusercontent.com/u/29154?v=3","gravatar_id":"","url":"https://api.github.com/users/lgebhardt","html_url":"https://github.com/lgebhardt","followers_url":"https://api.github.com/users/lgebhardt/followers","following_url":"https://api.github.com/users/lgebhardt/following{/other_user}","gists_url":"https://api.github.com/users/lgebhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/lgebhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgebhardt/subscriptions","organizations_url":"https://api.github.com/users/lgebhardt/orgs","repos_url":"https://api.github.com/users/lgebhardt/repos","events_url":"https://api.github.com/users/lgebhardt/events{/privacy}","received_events_url":"https://api.github.com/users/lgebhardt/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":2,"changed_files":1}}