{"action":"created","comment":{"url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/comments/167715784","pull_request_review_id":95975799,"id":167715784,"diff_hunk":"@@ -26,9 +26,17 @@ def ids_hash(ids, record_type)\n         id_hash(ids, record_type) # ids variable is just a single id here\n       end\n \n-      def attributes_hash(record)\n-        attributes_to_serialize.each_with_object({}) do |(key, method_name), attr_hash|\n-          attr_hash[key] = record.public_send(method_name)\n+      def attributes_hash(record, fields = nil)\n+        if fields.is_a? Array","path":"lib/fast_jsonapi/serialization_core.rb","position":8,"original_position":8,"commit_id":"e6d2a6adf93f59c8cf6b79ddcdff189885e11784","original_commit_id":"e6d2a6adf93f59c8cf6b79ddcdff189885e11784","user":{"login":"shishirmk","id":604135,"avatar_url":"https://avatars0.githubusercontent.com/u/604135?v=4","gravatar_id":"","url":"https://api.github.com/users/shishirmk","html_url":"https://github.com/shishirmk","followers_url":"https://api.github.com/users/shishirmk/followers","following_url":"https://api.github.com/users/shishirmk/following{/other_user}","gists_url":"https://api.github.com/users/shishirmk/gists{/gist_id}","starred_url":"https://api.github.com/users/shishirmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishirmk/subscriptions","organizations_url":"https://api.github.com/users/shishirmk/orgs","repos_url":"https://api.github.com/users/shishirmk/repos","events_url":"https://api.github.com/users/shishirmk/events{/privacy}","received_events_url":"https://api.github.com/users/shishirmk/received_events","type":"User","site_admin":false},"body":"Do you want to try using https://gitter.im/ to chat? I havent used it before but seems like a good place to chat https://gitter.im/fast_jsonapi/Lobby","created_at":"2018-02-12T23:07:41Z","updated_at":"2018-02-12T23:07:42Z","html_url":"https://github.com/Netflix/fast_jsonapi/pull/63#discussion_r167715784","pull_request_url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/comments/167715784"},"html":{"href":"https://github.com/Netflix/fast_jsonapi/pull/63#discussion_r167715784"},"pull_request":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63"}},"in_reply_to_id":166523867},"pull_request":{"url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63","id":167556064,"html_url":"https://github.com/Netflix/fast_jsonapi/pull/63","diff_url":"https://github.com/Netflix/fast_jsonapi/pull/63.diff","patch_url":"https://github.com/Netflix/fast_jsonapi/pull/63.patch","issue_url":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/63","number":63,"state":"open","locked":false,"title":"Sparse fieldsets support, addresses #57","user":{"login":"youroff","id":1385801,"avatar_url":"https://avatars3.githubusercontent.com/u/1385801?v=4","gravatar_id":"","url":"https://api.github.com/users/youroff","html_url":"https://github.com/youroff","followers_url":"https://api.github.com/users/youroff/followers","following_url":"https://api.github.com/users/youroff/following{/other_user}","gists_url":"https://api.github.com/users/youroff/gists{/gist_id}","starred_url":"https://api.github.com/users/youroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youroff/subscriptions","organizations_url":"https://api.github.com/users/youroff/orgs","repos_url":"https://api.github.com/users/youroff/repos","events_url":"https://api.github.com/users/youroff/events{/privacy}","received_events_url":"https://api.github.com/users/youroff/received_events","type":"User","site_admin":false},"body":"This PR addresses #57 \r\nIt provides support for sparse fieldsets per json-api spec. Usage:\r\n```ruby\r\noptions = {}\r\noptions[:meta] = { total: 2 }\r\noptions[:include] = [:actors]\r\noptions[:fields] = {\r\n  movie: ['name'], # will only include name attribute into attributes hash\r\n  actor: ['email'] # ...only email for included actors\r\n}\r\nMovieSerializer.new([movie, movie], options).serialized_json\r\n```","created_at":"2018-02-06T23:13:36Z","updated_at":"2018-02-12T23:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76dfff2bacc34b3a464774897b965738a1b4fd8e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/Netflix/fast_jsonapi/milestones/1","html_url":"https://github.com/Netflix/fast_jsonapi/milestone/1","labels_url":"https://api.github.com/repos/Netflix/fast_jsonapi/milestones/1/labels","id":3104287,"number":1,"title":"Version 1.1.0","description":"Since the day of it's launch on Jan 31, 2018 fast_jsonapi has become a really popular gem. The Ruby and the Rails community has contributed to several features and one bug fix. We have merged more than 30 pull requests and and reviewing the open ones. \r\n\r\nEven though it will be just 2 weeks since launch we think we have enough features to create a 1.1.0 release of fast_jsonapi. Here are the main features we know will be part of this release.\r\n\r\n1. Custom attributes defined in the serializer\r\n2. Key transforms with same list of transforms as AMS\r\n3. Reduced gem dependency list, Active support will be the only run time dependency\r\n4. Fix for the has one nil association bug\r\n5. Support for polymorphic associations\r\n6. Performance comparison with jsonapi-rb gem \r\n\r\nThings in the pipeline\r\n1. Support for sparse field sets as in the JSON:API spec\r\n2. Support for optional attributes as supported by AMS","creator":{"login":"shishirmk","id":604135,"avatar_url":"https://avatars0.githubusercontent.com/u/604135?v=4","gravatar_id":"","url":"https://api.github.com/users/shishirmk","html_url":"https://github.com/shishirmk","followers_url":"https://api.github.com/users/shishirmk/followers","following_url":"https://api.github.com/users/shishirmk/following{/other_user}","gists_url":"https://api.github.com/users/shishirmk/gists{/gist_id}","starred_url":"https://api.github.com/users/shishirmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shishirmk/subscriptions","organizations_url":"https://api.github.com/users/shishirmk/orgs","repos_url":"https://api.github.com/users/shishirmk/repos","events_url":"https://api.github.com/users/shishirmk/events{/privacy}","received_events_url":"https://api.github.com/users/shishirmk/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":1,"state":"open","created_at":"2018-02-10T02:27:08Z","updated_at":"2018-02-11T21:12:38Z","due_on":"2018-02-14T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63/commits","review_comments_url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63/comments","review_comment_url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/63/comments","statuses_url":"https://api.github.com/repos/Netflix/fast_jsonapi/statuses/e6d2a6adf93f59c8cf6b79ddcdff189885e11784","head":{"label":"youroff:feature/fields","ref":"feature/fields","sha":"e6d2a6adf93f59c8cf6b79ddcdff189885e11784","user":{"login":"youroff","id":1385801,"avatar_url":"https://avatars3.githubusercontent.com/u/1385801?v=4","gravatar_id":"","url":"https://api.github.com/users/youroff","html_url":"https://github.com/youroff","followers_url":"https://api.github.com/users/youroff/followers","following_url":"https://api.github.com/users/youroff/following{/other_user}","gists_url":"https://api.github.com/users/youroff/gists{/gist_id}","starred_url":"https://api.github.com/users/youroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youroff/subscriptions","organizations_url":"https://api.github.com/users/youroff/orgs","repos_url":"https://api.github.com/users/youroff/repos","events_url":"https://api.github.com/users/youroff/events{/privacy}","received_events_url":"https://api.github.com/users/youroff/received_events","type":"User","site_admin":false},"repo":{"id":120519943,"name":"fast_jsonapi","full_name":"youroff/fast_jsonapi","owner":{"login":"youroff","id":1385801,"avatar_url":"https://avatars3.githubusercontent.com/u/1385801?v=4","gravatar_id":"","url":"https://api.github.com/users/youroff","html_url":"https://github.com/youroff","followers_url":"https://api.github.com/users/youroff/followers","following_url":"https://api.github.com/users/youroff/following{/other_user}","gists_url":"https://api.github.com/users/youroff/gists{/gist_id}","starred_url":"https://api.github.com/users/youroff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youroff/subscriptions","organizations_url":"https://api.github.com/users/youroff/orgs","repos_url":"https://api.github.com/users/youroff/repos","events_url":"https://api.github.com/users/youroff/events{/privacy}","received_events_url":"https://api.github.com/users/youroff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/youroff/fast_jsonapi","description":"A lightning fast JSON:API serializer for Ruby Objects.","fork":true,"url":"https://api.github.com/repos/youroff/fast_jsonapi","forks_url":"https://api.github.com/repos/youroff/fast_jsonapi/forks","keys_url":"https://api.github.com/repos/youroff/fast_jsonapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/youroff/fast_jsonapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/youroff/fast_jsonapi/teams","hooks_url":"https://api.github.com/repos/youroff/fast_jsonapi/hooks","issue_events_url":"https://api.github.com/repos/youroff/fast_jsonapi/issues/events{/number}","events_url":"https://api.github.com/repos/youroff/fast_jsonapi/events","assignees_url":"https://api.github.com/repos/youroff/fast_jsonapi/assignees{/user}","branches_url":"https://api.github.com/repos/youroff/fast_jsonapi/branches{/branch}","tags_url":"https://api.github.com/repos/youroff/fast_jsonapi/tags","blobs_url":"https://api.github.com/repos/youroff/fast_jsonapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/youroff/fast_jsonapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/youroff/fast_jsonapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/youroff/fast_jsonapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/youroff/fast_jsonapi/statuses/{sha}","languages_url":"https://api.github.com/repos/youroff/fast_jsonapi/languages","stargazers_url":"https://api.github.com/repos/youroff/fast_jsonapi/stargazers","contributors_url":"https://api.github.com/repos/youroff/fast_jsonapi/contributors","subscribers_url":"https://api.github.com/repos/youroff/fast_jsonapi/subscribers","subscription_url":"https://api.github.com/repos/youroff/fast_jsonapi/subscription","commits_url":"https://api.github.com/repos/youroff/fast_jsonapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/youroff/fast_jsonapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/youroff/fast_jsonapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/youroff/fast_jsonapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/youroff/fast_jsonapi/contents/{+path}","compare_url":"https://api.github.com/repos/youroff/fast_jsonapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/youroff/fast_jsonapi/merges","archive_url":"https://api.github.com/repos/youroff/fast_jsonapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/youroff/fast_jsonapi/downloads","issues_url":"https://api.github.com/repos/youroff/fast_jsonapi/issues{/number}","pulls_url":"https://api.github.com/repos/youroff/fast_jsonapi/pulls{/number}","milestones_url":"https://api.github.com/repos/youroff/fast_jsonapi/milestones{/number}","notifications_url":"https://api.github.com/repos/youroff/fast_jsonapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/youroff/fast_jsonapi/labels{/name}","releases_url":"https://api.github.com/repos/youroff/fast_jsonapi/releases{/id}","deployments_url":"https://api.github.com/repos/youroff/fast_jsonapi/deployments","created_at":"2018-02-06T20:34:14Z","updated_at":"2018-02-06T20:34:15Z","pushed_at":"2018-02-06T22:46:08Z","git_url":"git://github.com/youroff/fast_jsonapi.git","ssh_url":"git@github.com:youroff/fast_jsonapi.git","clone_url":"https://github.com/youroff/fast_jsonapi.git","svn_url":"https://github.com/youroff/fast_jsonapi","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Netflix:dev","ref":"dev","sha":"fcca5063ca3d541a53fa384cf36cb3131a91c005","user":{"login":"Netflix","id":913567,"avatar_url":"https://avatars3.githubusercontent.com/u/913567?v=4","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"repo":{"id":119760423,"name":"fast_jsonapi","full_name":"Netflix/fast_jsonapi","owner":{"login":"Netflix","id":913567,"avatar_url":"https://avatars3.githubusercontent.com/u/913567?v=4","gravatar_id":"","url":"https://api.github.com/users/Netflix","html_url":"https://github.com/Netflix","followers_url":"https://api.github.com/users/Netflix/followers","following_url":"https://api.github.com/users/Netflix/following{/other_user}","gists_url":"https://api.github.com/users/Netflix/gists{/gist_id}","starred_url":"https://api.github.com/users/Netflix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Netflix/subscriptions","organizations_url":"https://api.github.com/users/Netflix/orgs","repos_url":"https://api.github.com/users/Netflix/repos","events_url":"https://api.github.com/users/Netflix/events{/privacy}","received_events_url":"https://api.github.com/users/Netflix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Netflix/fast_jsonapi","description":"A lightning fast JSON:API serializer for Ruby Objects.","fork":false,"url":"https://api.github.com/repos/Netflix/fast_jsonapi","forks_url":"https://api.github.com/repos/Netflix/fast_jsonapi/forks","keys_url":"https://api.github.com/repos/Netflix/fast_jsonapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Netflix/fast_jsonapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Netflix/fast_jsonapi/teams","hooks_url":"https://api.github.com/repos/Netflix/fast_jsonapi/hooks","issue_events_url":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/events{/number}","events_url":"https://api.github.com/repos/Netflix/fast_jsonapi/events","assignees_url":"https://api.github.com/repos/Netflix/fast_jsonapi/assignees{/user}","branches_url":"https://api.github.com/repos/Netflix/fast_jsonapi/branches{/branch}","tags_url":"https://api.github.com/repos/Netflix/fast_jsonapi/tags","blobs_url":"https://api.github.com/repos/Netflix/fast_jsonapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Netflix/fast_jsonapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Netflix/fast_jsonapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Netflix/fast_jsonapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Netflix/fast_jsonapi/statuses/{sha}","languages_url":"https://api.github.com/repos/Netflix/fast_jsonapi/languages","stargazers_url":"https://api.github.com/repos/Netflix/fast_jsonapi/stargazers","contributors_url":"https://api.github.com/repos/Netflix/fast_jsonapi/contributors","subscribers_url":"https://api.github.com/repos/Netflix/fast_jsonapi/subscribers","subscription_url":"https://api.github.com/repos/Netflix/fast_jsonapi/subscription","commits_url":"https://api.github.com/repos/Netflix/fast_jsonapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Netflix/fast_jsonapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Netflix/fast_jsonapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Netflix/fast_jsonapi/contents/{+path}","compare_url":"https://api.github.com/repos/Netflix/fast_jsonapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Netflix/fast_jsonapi/merges","archive_url":"https://api.github.com/repos/Netflix/fast_jsonapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Netflix/fast_jsonapi/downloads","issues_url":"https://api.github.com/repos/Netflix/fast_jsonapi/issues{/number}","pulls_url":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls{/number}","milestones_url":"https://api.github.com/repos/Netflix/fast_jsonapi/milestones{/number}","notifications_url":"https://api.github.com/repos/Netflix/fast_jsonapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Netflix/fast_jsonapi/labels{/name}","releases_url":"https://api.github.com/repos/Netflix/fast_jsonapi/releases{/id}","deployments_url":"https://api.github.com/repos/Netflix/fast_jsonapi/deployments","created_at":"2018-02-01T00:19:19Z","updated_at":"2018-02-12T22:57:50Z","pushed_at":"2018-02-12T18:14:09Z","git_url":"git://github.com/Netflix/fast_jsonapi.git","ssh_url":"git@github.com:Netflix/fast_jsonapi.git","clone_url":"https://github.com/Netflix/fast_jsonapi.git","svn_url":"https://github.com/Netflix/fast_jsonapi","homepage":null,"size":87,"stargazers_count":1917,"watchers_count":1917,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":77,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":77,"open_issues":29,"watchers":1917,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63"},"html":{"href":"https://github.com/Netflix/fast_jsonapi/pull/63"},"issue":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/63"},"comments":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/Netflix/fast_jsonapi/statuses/e6d2a6adf93f59c8cf6b79ddcdff189885e11784"}},"author_association":"NONE"}}
{"actor":{"display_login":"shishirmk"}}