{"action":"created","issue":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2043","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/2043/labels{/name}","comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2043/comments","events_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2043/events","html_url":"https://github.com/rails-api/active_model_serializers/issues/2043","id":204092829,"number":2043,"title":"Serializer.attributes fails with unclear message when an attribute is `:method`","user":{"login":"dongtong","id":319788,"avatar_url":"https://avatars1.githubusercontent.com/u/319788?v=3","gravatar_id":"","url":"https://api.github.com/users/dongtong","html_url":"https://github.com/dongtong","followers_url":"https://api.github.com/users/dongtong/followers","following_url":"https://api.github.com/users/dongtong/following{/other_user}","gists_url":"https://api.github.com/users/dongtong/gists{/gist_id}","starred_url":"https://api.github.com/users/dongtong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongtong/subscriptions","organizations_url":"https://api.github.com/users/dongtong/orgs","repos_url":"https://api.github.com/users/dongtong/repos","events_url":"https://api.github.com/users/dongtong/events{/privacy}","received_events_url":"https://api.github.com/users/dongtong/received_events","type":"User","site_admin":false},"labels":[{"id":184618099,"url":"https://api.github.com/repos/rails-api/active_model_serializers/labels/S:%20Ready%20for%20PR","name":"S: Ready for PR","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-01-30T18:34:43Z","updated_at":"2017-05-10T13:50:37Z","closed_at":null,"body":"#### Expected behavior vs actual behavior\r\nIf attributes list has keyword, the serializer will be failed, the error is \r\n\r\n`Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::Attributes ArgumentError: wrong number of arguments (given 0, expected 1)\r\n`\r\n```\r\nclass ApiSerializer < ApplicationSerializer\r\n  attributes :id,\r\n             :group_name,\r\n             :name,\r\n             :endpoint,\r\n             :method,\r\n             :version,\r\n             :created_at,\r\n             :updated_at,\r\n             :description\r\n  #...\r\nend\r\n```\r\n\r\n### Solutions\r\n\r\n```\r\nclass ApiSerializer < ApplicationSerializer\r\n  attributes :id,\r\n             :group_name,\r\n             :name,\r\n             :endpoint,\r\n             :version,\r\n             :created_at,\r\n             :updated_at,\r\n             :description\r\n  attribute :method\r\n\r\n  def method\r\n     object.method\r\n  end\r\nend\r\n```\r\n\r\nI think active_model_serializers should tell the developer that attributes should not include keywords, otherwise, the developer will not know the error's detail information. If I have time, I will create PR, but I want the library creator could improve this issue.\r\n\r\nThanks a lot\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/comments/300487947","html_url":"https://github.com/rails-api/active_model_serializers/issues/2043#issuecomment-300487947","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/2043","id":300487947,"user":{"login":"xlts","id":11663627,"avatar_url":"https://avatars3.githubusercontent.com/u/11663627?v=3","gravatar_id":"","url":"https://api.github.com/users/xlts","html_url":"https://github.com/xlts","followers_url":"https://api.github.com/users/xlts/followers","following_url":"https://api.github.com/users/xlts/following{/other_user}","gists_url":"https://api.github.com/users/xlts/gists{/gist_id}","starred_url":"https://api.github.com/users/xlts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlts/subscriptions","organizations_url":"https://api.github.com/users/xlts/orgs","repos_url":"https://api.github.com/users/xlts/repos","events_url":"https://api.github.com/users/xlts/events{/privacy}","received_events_url":"https://api.github.com/users/xlts/received_events","type":"User","site_admin":false},"created_at":"2017-05-10T13:50:36Z","updated_at":"2017-05-10T13:50:36Z","body":"@bf4 I suppose I'll wait for a new release as you tackled the issue already. Unless there is something else I can help with?"}}
{"actor":{"display_login":"xlts"}}