{"action":"closed","number":812,"pull_request":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812","id":29266272,"html_url":"https://github.com/rails-api/active_model_serializers/pull/812","diff_url":"https://github.com/rails-api/active_model_serializers/pull/812.diff","patch_url":"https://github.com/rails-api/active_model_serializers/pull/812.patch","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/812","number":812,"state":"closed","locked":false,"title":"Returning DefaultSerializer when nil is passed to serializer_for","user":{"login":"nstruthers","id":1252258,"avatar_url":"https://avatars.githubusercontent.com/u/1252258?v=3","gravatar_id":"","url":"https://api.github.com/users/nstruthers","html_url":"https://github.com/nstruthers","followers_url":"https://api.github.com/users/nstruthers/followers","following_url":"https://api.github.com/users/nstruthers/following{/other_user}","gists_url":"https://api.github.com/users/nstruthers/gists{/gist_id}","starred_url":"https://api.github.com/users/nstruthers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nstruthers/subscriptions","organizations_url":"https://api.github.com/users/nstruthers/orgs","repos_url":"https://api.github.com/users/nstruthers/repos","events_url":"https://api.github.com/users/nstruthers/events{/privacy}","received_events_url":"https://api.github.com/users/nstruthers/received_events","type":"User","site_admin":false},"body":"This avoids a costly `_const_get` search for a non-existent `NilClassSerializer`. We hit a performance issue when serializing thousands of records that had a `has_one` association that could potentially be nil--the `_const_get` search was responsible for about 26 seconds of a 28 second `to_json` call. It can be fixed by adding an empty `NilClassSerializer`, but this seems like the better fix.","created_at":"2015-02-13T14:01:39Z","updated_at":"2016-03-17T18:15:06Z","closed_at":"2016-03-17T18:15:06Z","merged_at":null,"merge_commit_sha":"2abb3daca02128536cdd6ea6df468d023df84c18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812/commits","review_comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812/comments","review_comment_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/812/comments","statuses_url":"https://api.github.com/repos/rails-api/active_model_serializers/statuses/f7355dcb74c8d659922e8681b424949b5c0c8d1c","head":{"label":"nstruthers:0-9-stable","ref":"0-9-stable","sha":"f7355dcb74c8d659922e8681b424949b5c0c8d1c","user":{"login":"nstruthers","id":1252258,"avatar_url":"https://avatars.githubusercontent.com/u/1252258?v=3","gravatar_id":"","url":"https://api.github.com/users/nstruthers","html_url":"https://github.com/nstruthers","followers_url":"https://api.github.com/users/nstruthers/followers","following_url":"https://api.github.com/users/nstruthers/following{/other_user}","gists_url":"https://api.github.com/users/nstruthers/gists{/gist_id}","starred_url":"https://api.github.com/users/nstruthers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nstruthers/subscriptions","organizations_url":"https://api.github.com/users/nstruthers/orgs","repos_url":"https://api.github.com/users/nstruthers/repos","events_url":"https://api.github.com/users/nstruthers/events{/privacy}","received_events_url":"https://api.github.com/users/nstruthers/received_events","type":"User","site_admin":false},"repo":{"id":30754379,"name":"active_model_serializers","full_name":"nstruthers/active_model_serializers","owner":{"login":"nstruthers","id":1252258,"avatar_url":"https://avatars.githubusercontent.com/u/1252258?v=3","gravatar_id":"","url":"https://api.github.com/users/nstruthers","html_url":"https://github.com/nstruthers","followers_url":"https://api.github.com/users/nstruthers/followers","following_url":"https://api.github.com/users/nstruthers/following{/other_user}","gists_url":"https://api.github.com/users/nstruthers/gists{/gist_id}","starred_url":"https://api.github.com/users/nstruthers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nstruthers/subscriptions","organizations_url":"https://api.github.com/users/nstruthers/orgs","repos_url":"https://api.github.com/users/nstruthers/repos","events_url":"https://api.github.com/users/nstruthers/events{/privacy}","received_events_url":"https://api.github.com/users/nstruthers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nstruthers/active_model_serializers","description":"ActiveModel::Serializer implementation and Rails hooks","fork":true,"url":"https://api.github.com/repos/nstruthers/active_model_serializers","forks_url":"https://api.github.com/repos/nstruthers/active_model_serializers/forks","keys_url":"https://api.github.com/repos/nstruthers/active_model_serializers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nstruthers/active_model_serializers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nstruthers/active_model_serializers/teams","hooks_url":"https://api.github.com/repos/nstruthers/active_model_serializers/hooks","issue_events_url":"https://api.github.com/repos/nstruthers/active_model_serializers/issues/events{/number}","events_url":"https://api.github.com/repos/nstruthers/active_model_serializers/events","assignees_url":"https://api.github.com/repos/nstruthers/active_model_serializers/assignees{/user}","branches_url":"https://api.github.com/repos/nstruthers/active_model_serializers/branches{/branch}","tags_url":"https://api.github.com/repos/nstruthers/active_model_serializers/tags","blobs_url":"https://api.github.com/repos/nstruthers/active_model_serializers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nstruthers/active_model_serializers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nstruthers/active_model_serializers/git/refs{/sha}","trees_url":"https://api.github.com/repos/nstruthers/active_model_serializers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nstruthers/active_model_serializers/statuses/{sha}","languages_url":"https://api.github.com/repos/nstruthers/active_model_serializers/languages","stargazers_url":"https://api.github.com/repos/nstruthers/active_model_serializers/stargazers","contributors_url":"https://api.github.com/repos/nstruthers/active_model_serializers/contributors","subscribers_url":"https://api.github.com/repos/nstruthers/active_model_serializers/subscribers","subscription_url":"https://api.github.com/repos/nstruthers/active_model_serializers/subscription","commits_url":"https://api.github.com/repos/nstruthers/active_model_serializers/commits{/sha}","git_commits_url":"https://api.github.com/repos/nstruthers/active_model_serializers/git/commits{/sha}","comments_url":"https://api.github.com/repos/nstruthers/active_model_serializers/comments{/number}","issue_comment_url":"https://api.github.com/repos/nstruthers/active_model_serializers/issues/comments{/number}","contents_url":"https://api.github.com/repos/nstruthers/active_model_serializers/contents/{+path}","compare_url":"https://api.github.com/repos/nstruthers/active_model_serializers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nstruthers/active_model_serializers/merges","archive_url":"https://api.github.com/repos/nstruthers/active_model_serializers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nstruthers/active_model_serializers/downloads","issues_url":"https://api.github.com/repos/nstruthers/active_model_serializers/issues{/number}","pulls_url":"https://api.github.com/repos/nstruthers/active_model_serializers/pulls{/number}","milestones_url":"https://api.github.com/repos/nstruthers/active_model_serializers/milestones{/number}","notifications_url":"https://api.github.com/repos/nstruthers/active_model_serializers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nstruthers/active_model_serializers/labels{/name}","releases_url":"https://api.github.com/repos/nstruthers/active_model_serializers/releases{/id}","deployments_url":"https://api.github.com/repos/nstruthers/active_model_serializers/deployments","created_at":"2015-02-13T11:53:43Z","updated_at":"2015-02-13T11:53:44Z","pushed_at":"2015-02-18T10:22:02Z","git_url":"git://github.com/nstruthers/active_model_serializers.git","ssh_url":"git@github.com:nstruthers/active_model_serializers.git","clone_url":"https://github.com/nstruthers/active_model_serializers.git","svn_url":"https://github.com/nstruthers/active_model_serializers","homepage":"","size":1257,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails-api:0-9-stable","ref":"0-9-stable","sha":"f71ac766efa8cf7a8f595eba531c7fb8867b4001","user":{"login":"rails-api","id":2820360,"avatar_url":"https://avatars.githubusercontent.com/u/2820360?v=3","gravatar_id":"","url":"https://api.github.com/users/rails-api","html_url":"https://github.com/rails-api","followers_url":"https://api.github.com/users/rails-api/followers","following_url":"https://api.github.com/users/rails-api/following{/other_user}","gists_url":"https://api.github.com/users/rails-api/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-api/subscriptions","organizations_url":"https://api.github.com/users/rails-api/orgs","repos_url":"https://api.github.com/users/rails-api/repos","events_url":"https://api.github.com/users/rails-api/events{/privacy}","received_events_url":"https://api.github.com/users/rails-api/received_events","type":"Organization","site_admin":false},"repo":{"id":2889230,"name":"active_model_serializers","full_name":"rails-api/active_model_serializers","owner":{"login":"rails-api","id":2820360,"avatar_url":"https://avatars.githubusercontent.com/u/2820360?v=3","gravatar_id":"","url":"https://api.github.com/users/rails-api","html_url":"https://github.com/rails-api","followers_url":"https://api.github.com/users/rails-api/followers","following_url":"https://api.github.com/users/rails-api/following{/other_user}","gists_url":"https://api.github.com/users/rails-api/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-api/subscriptions","organizations_url":"https://api.github.com/users/rails-api/orgs","repos_url":"https://api.github.com/users/rails-api/repos","events_url":"https://api.github.com/users/rails-api/events{/privacy}","received_events_url":"https://api.github.com/users/rails-api/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails-api/active_model_serializers","description":"ActiveModel::Serializer implementation and Rails hooks","fork":false,"url":"https://api.github.com/repos/rails-api/active_model_serializers","forks_url":"https://api.github.com/repos/rails-api/active_model_serializers/forks","keys_url":"https://api.github.com/repos/rails-api/active_model_serializers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails-api/active_model_serializers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails-api/active_model_serializers/teams","hooks_url":"https://api.github.com/repos/rails-api/active_model_serializers/hooks","issue_events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/events{/number}","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/events","assignees_url":"https://api.github.com/repos/rails-api/active_model_serializers/assignees{/user}","branches_url":"https://api.github.com/repos/rails-api/active_model_serializers/branches{/branch}","tags_url":"https://api.github.com/repos/rails-api/active_model_serializers/tags","blobs_url":"https://api.github.com/repos/rails-api/active_model_serializers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails-api/active_model_serializers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails-api/active_model_serializers/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails-api/active_model_serializers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails-api/active_model_serializers/statuses/{sha}","languages_url":"https://api.github.com/repos/rails-api/active_model_serializers/languages","stargazers_url":"https://api.github.com/repos/rails-api/active_model_serializers/stargazers","contributors_url":"https://api.github.com/repos/rails-api/active_model_serializers/contributors","subscribers_url":"https://api.github.com/repos/rails-api/active_model_serializers/subscribers","subscription_url":"https://api.github.com/repos/rails-api/active_model_serializers/subscription","commits_url":"https://api.github.com/repos/rails-api/active_model_serializers/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails-api/active_model_serializers/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails-api/active_model_serializers/contents/{+path}","compare_url":"https://api.github.com/repos/rails-api/active_model_serializers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails-api/active_model_serializers/merges","archive_url":"https://api.github.com/repos/rails-api/active_model_serializers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails-api/active_model_serializers/downloads","issues_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues{/number}","pulls_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls{/number}","milestones_url":"https://api.github.com/repos/rails-api/active_model_serializers/milestones{/number}","notifications_url":"https://api.github.com/repos/rails-api/active_model_serializers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails-api/active_model_serializers/labels{/name}","releases_url":"https://api.github.com/repos/rails-api/active_model_serializers/releases{/id}","deployments_url":"https://api.github.com/repos/rails-api/active_model_serializers/deployments","created_at":"2011-12-01T06:39:26Z","updated_at":"2016-03-17T16:57:16Z","pushed_at":"2016-03-17T16:54:33Z","git_url":"git://github.com/rails-api/active_model_serializers.git","ssh_url":"git@github.com:rails-api/active_model_serializers.git","clone_url":"https://github.com/rails-api/active_model_serializers.git","svn_url":"https://github.com/rails-api/active_model_serializers","homepage":"","size":4188,"stargazers_count":3382,"watchers_count":3382,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":839,"mirror_url":null,"open_issues_count":104,"forks":839,"open_issues":104,"watchers":3382,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812"},"html":{"href":"https://github.com/rails-api/active_model_serializers/pull/812"},"issue":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/issues/812"},"comments":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/issues/812/comments"},"review_comments":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812/comments"},"review_comment":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/812/commits"},"statuses":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/statuses/f7355dcb74c8d659922e8681b424949b5c0c8d1c"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":4,"review_comments":0,"commits":2,"additions":16,"deletions":1,"changed_files":3}}