{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2009","repository_url":"https://api.github.com/repos/rails-api/active_model_serializers","labels_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2009/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2009/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2009/events","html_url":"https://github.com/rails-api/active_model_serializers/issues/2009","id":196615755,"number":2009,"title":"Rendered ActiveModel::Serializer::Null with Hash","user":{"login":"hanluner","id":1802563,"avatar_url":"https://avatars.githubusercontent.com/u/1802563?v=3","gravatar_id":"","url":"https://api.github.com/users/hanluner","html_url":"https://github.com/hanluner","followers_url":"https://api.github.com/users/hanluner/followers","following_url":"https://api.github.com/users/hanluner/following{/other_user}","gists_url":"https://api.github.com/users/hanluner/gists{/gist_id}","starred_url":"https://api.github.com/users/hanluner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanluner/subscriptions","organizations_url":"https://api.github.com/users/hanluner/orgs","repos_url":"https://api.github.com/users/hanluner/repos","events_url":"https://api.github.com/users/hanluner/events{/privacy}","received_events_url":"https://api.github.com/users/hanluner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-20T08:44:19Z","updated_at":"2016-12-21T02:57:37Z","closed_at":null,"body":"#### Expected behavior vs actual behavior\r\nWhen I use:\r\n`render json: { status: 1, result: UserSerializer.new(user) }`\r\n\r\nLog file output:\r\n`[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.37ms)`\r\n\r\nI don't want it, how can I fix the bug?\r\n\r\n#### Environment\r\n\r\nActiveModelSerializers Version *(commit ref if not on tag)*: 0.10.0\r\n\r\nOutput of `ruby -e \"puts RUBY_DESCRIPTION\"`: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]\r\n\r\nOS Type & Version: macOS Sierra\r\n\r\nIntegrated application and version *(e.g., Rails, Grape, etc)*: Rails 5.0.0.1\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/268421456","html_url":"https://github.com/rails-api/active_model_serializers/issues/2009#issuecomment-268421456","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2009","id":268421456,"user":{"login":"bf4","id":142914,"avatar_url":"https://avatars.githubusercontent.com/u/142914?v=3","gravatar_id":"","url":"https://api.github.com/users/bf4","html_url":"https://github.com/bf4","followers_url":"https://api.github.com/users/bf4/followers","following_url":"https://api.github.com/users/bf4/following{/other_user}","gists_url":"https://api.github.com/users/bf4/gists{/gist_id}","starred_url":"https://api.github.com/users/bf4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bf4/subscriptions","organizations_url":"https://api.github.com/users/bf4/orgs","repos_url":"https://api.github.com/users/bf4/repos","events_url":"https://api.github.com/users/bf4/events{/privacy}","received_events_url":"https://api.github.com/users/bf4/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T02:57:37Z","updated_at":"2016-12-21T02:57:37Z","body":"@hanluner Doing something like `render json: { status: 1, result: UserSerializer.new(user) }` requires some understanding of what you're doing, since it's not a normal usage for AMS.  Maybe that worked in an earlier version. I don't know.  But, I think what you're trying to do is `render json: { status: 1, result: UserSerializer.new(user).as_json }` which is more or less equivalent to serializing with the attributes adapter, as long as you're not using caching. \r\n\r\nYou're getting that message because you're passing in a hash `{ status: 1, result: user_json }`, which has no AMS serializer. (nor can it). I'm actually not sure why it's being processed by AMS at all."}}
{"actor":{"display_login":"bf4"}}