{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1868","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/1868/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1868/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1868/events","html_url":"https://github.com/rails-api/active_model_serializers/issues/1868","id":168922768,"number":1868,"title":"0.9.x meta_key has to be a symbol and will not work for a string","user":{"login":"vinodlala","id":5471958,"avatar_url":"https://avatars.githubusercontent.com/u/5471958?v=3","gravatar_id":"","url":"https://api.github.com/users/vinodlala","html_url":"https://github.com/vinodlala","followers_url":"https://api.github.com/users/vinodlala/followers","following_url":"https://api.github.com/users/vinodlala/following{/other_user}","gists_url":"https://api.github.com/users/vinodlala/gists{/gist_id}","starred_url":"https://api.github.com/users/vinodlala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinodlala/subscriptions","organizations_url":"https://api.github.com/users/vinodlala/orgs","repos_url":"https://api.github.com/users/vinodlala/repos","events_url":"https://api.github.com/users/vinodlala/events{/privacy}","received_events_url":"https://api.github.com/users/vinodlala/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/C:%20Documentation","name":"C: Documentation","color":"fbca04"},{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/C:%20Good%20for%20New%20Contributors","name":"C: Good for New Contributors","color":"ACCEEE"},{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/S:%20Ready%20for%20PR","name":"S: Ready for PR","color":"009800"},{"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/V:%200.9.x","name":"V: 0.9.x","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-02T15:57:50Z","updated_at":"2016-08-02T17:47:06Z","closed_at":null,"body":"For `meta_key`, use a symbol instead of a string.\r\n\r\nThe docs on http://www.rubydoc.info/gems/active_model_serializers/0.9.5 has this:\r\n\r\n```\r\nrender json: @posts, serializer: CustomArraySerializer, meta_object: {total: 10}, meta_key: 'meta_object'\r\n```\r\n\r\nBut that doesn't work.\r\n\r\nThis will work:\r\n\r\n```\r\nrender json: @posts, serializer: CustomArraySerializer, meta_object: {total: 10}, meta_key: :meta_object\r\n```\r\n\r\nIn `lib/active_model/serializer.rb`, check out the `initialize` method:\r\n\r\n```\r\n      @meta_key      = options[:meta_key] || :meta\r\n      @meta          = options[@meta_key]\r\n```\r\n\r\nIf `options[:meta_key]` is `nil`, `@meta_key` is `:meta` (a symbol, not a string).\r\n\r\nUsing the example in the docs, if `options[:meta_key]` is a string like `'meta_object'`, `@meta_key` is `'meta_object'` (a string, not a symbol).  \r\n\r\nHowever, `options['meta_object']` does not exist. Only `options[:meta_object]` exists.\r\n\r\nIf `options[:meta_key]` is a symbol like `:meta_object`, `@meta_key` is `:meta_object`, which works.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/236984347","html_url":"https://github.com/rails-api/active_model_serializers/issues/1868#issuecomment-236984347","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/1868","id":236984347,"user":{"login":"vinodlala","id":5471958,"avatar_url":"https://avatars.githubusercontent.com/u/5471958?v=3","gravatar_id":"","url":"https://api.github.com/users/vinodlala","html_url":"https://github.com/vinodlala","followers_url":"https://api.github.com/users/vinodlala/followers","following_url":"https://api.github.com/users/vinodlala/following{/other_user}","gists_url":"https://api.github.com/users/vinodlala/gists{/gist_id}","starred_url":"https://api.github.com/users/vinodlala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinodlala/subscriptions","organizations_url":"https://api.github.com/users/vinodlala/orgs","repos_url":"https://api.github.com/users/vinodlala/repos","events_url":"https://api.github.com/users/vinodlala/events{/privacy}","received_events_url":"https://api.github.com/users/vinodlala/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T17:47:06Z","updated_at":"2016-08-02T17:47:06Z","body":"Done - https://github.com/rails-api/active_model_serializers/pull/1869"}}
{"actor":{"display_login":"vinodlala"}}