{"action":"created","comment":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/comments/33948869","id":33948869,"diff_hunk":"@@ -45,21 +45,20 @@ def setup\n       end\n \n       def test_has_many_and_has_one\n-        assert_equal(\n-          { posts: { type: :has_many, association_options: { embed: :ids } },\n-            roles: { type: :has_many, association_options: { embed: :ids } },\n-            bio: { type: :has_one, association_options: {} } },\n-          @author_serializer.class._associations\n-        )\n-        @author_serializer.each_association do |name, serializer, options|\n-          if name == :posts\n-            assert_equal({embed: :ids}, options)\n+        @author_serializer.associations.each do |association|\n+          name = association.name\n+          serializer = association.serializer\n+          options = association.options\n+\n+          case name\n+          when :posts\n+            assert_equal({ embed: :ids }, options)\n             assert_kind_of(ActiveModel::Serializer.config.array_serializer, serializer)\n-          elsif name == :bio\n+          when :bio\n             assert_equal({}, options)\n             assert_nil serializer\n-          elsif name == :roles\n-            assert_equal({embed: :ids}, options)\n+          when :roles","path":"test/serializers/associations_test.rb","position":28,"original_position":28,"commit_id":"0768d0422250771384c5fd5df736082fad00825a","original_commit_id":"0768d0422250771384c5fd5df736082fad00825a","user":{"login":"joaomdmoura","id":667063,"avatar_url":"https://avatars.githubusercontent.com/u/667063?v=3","gravatar_id":"","url":"https://api.github.com/users/joaomdmoura","html_url":"https://github.com/joaomdmoura","followers_url":"https://api.github.com/users/joaomdmoura/followers","following_url":"https://api.github.com/users/joaomdmoura/following{/other_user}","gists_url":"https://api.github.com/users/joaomdmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/joaomdmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joaomdmoura/subscriptions","organizations_url":"https://api.github.com/users/joaomdmoura/orgs","repos_url":"https://api.github.com/users/joaomdmoura/repos","events_url":"https://api.github.com/users/joaomdmoura/events{/privacy}","received_events_url":"https://api.github.com/users/joaomdmoura/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-07-06T15:49:13Z","updated_at":"2015-07-06T15:49:13Z","html_url":"https://github.com/rails-api/active_model_serializers/pull/985#discussion_r33948869","pull_request_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985","_links":{"self":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/comments/33948869"},"html":{"href":"https://github.com/rails-api/active_model_serializers/pull/985#discussion_r33948869"},"pull_request":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985"}}},"pull_request":{"url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985","id":39247052,"html_url":"https://github.com/rails-api/active_model_serializers/pull/985","diff_url":"https://github.com/rails-api/active_model_serializers/pull/985.diff","patch_url":"https://github.com/rails-api/active_model_serializers/pull/985.patch","issue_url":"https://api.github.com/repos/rails-api/active_model_serializers/issues/985","number":985,"state":"open","locked":false,"title":"Do not iterate if no block given","user":{"login":"bolshakov","id":991265,"avatar_url":"https://avatars.githubusercontent.com/u/991265?v=3","gravatar_id":"","url":"https://api.github.com/users/bolshakov","html_url":"https://github.com/bolshakov","followers_url":"https://api.github.com/users/bolshakov/followers","following_url":"https://api.github.com/users/bolshakov/following{/other_user}","gists_url":"https://api.github.com/users/bolshakov/gists{/gist_id}","starred_url":"https://api.github.com/users/bolshakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolshakov/subscriptions","organizations_url":"https://api.github.com/users/bolshakov/orgs","repos_url":"https://api.github.com/users/bolshakov/repos","events_url":"https://api.github.com/users/bolshakov/events{/privacy}","received_events_url":"https://api.github.com/users/bolshakov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-06T08:51:12Z","updated_at":"2015-07-06T15:49:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f756fea9ecc6705af843f6a2b151fd64505fe955","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985/commits","review_comments_url":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985/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/985/comments","statuses_url":"https://api.github.com/repos/rails-api/active_model_serializers/statuses/0768d0422250771384c5fd5df736082fad00825a","head":{"label":"bolshakov:feature/each_association","ref":"feature/each_association","sha":"0768d0422250771384c5fd5df736082fad00825a","user":{"login":"bolshakov","id":991265,"avatar_url":"https://avatars.githubusercontent.com/u/991265?v=3","gravatar_id":"","url":"https://api.github.com/users/bolshakov","html_url":"https://github.com/bolshakov","followers_url":"https://api.github.com/users/bolshakov/followers","following_url":"https://api.github.com/users/bolshakov/following{/other_user}","gists_url":"https://api.github.com/users/bolshakov/gists{/gist_id}","starred_url":"https://api.github.com/users/bolshakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolshakov/subscriptions","organizations_url":"https://api.github.com/users/bolshakov/orgs","repos_url":"https://api.github.com/users/bolshakov/repos","events_url":"https://api.github.com/users/bolshakov/events{/privacy}","received_events_url":"https://api.github.com/users/bolshakov/received_events","type":"User","site_admin":false},"repo":{"id":23064094,"name":"active_model_serializers","full_name":"bolshakov/active_model_serializers","owner":{"login":"bolshakov","id":991265,"avatar_url":"https://avatars.githubusercontent.com/u/991265?v=3","gravatar_id":"","url":"https://api.github.com/users/bolshakov","html_url":"https://github.com/bolshakov","followers_url":"https://api.github.com/users/bolshakov/followers","following_url":"https://api.github.com/users/bolshakov/following{/other_user}","gists_url":"https://api.github.com/users/bolshakov/gists{/gist_id}","starred_url":"https://api.github.com/users/bolshakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolshakov/subscriptions","organizations_url":"https://api.github.com/users/bolshakov/orgs","repos_url":"https://api.github.com/users/bolshakov/repos","events_url":"https://api.github.com/users/bolshakov/events{/privacy}","received_events_url":"https://api.github.com/users/bolshakov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bolshakov/active_model_serializers","description":"ActiveModel::Serializer implementation and Rails hooks","fork":true,"url":"https://api.github.com/repos/bolshakov/active_model_serializers","forks_url":"https://api.github.com/repos/bolshakov/active_model_serializers/forks","keys_url":"https://api.github.com/repos/bolshakov/active_model_serializers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bolshakov/active_model_serializers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bolshakov/active_model_serializers/teams","hooks_url":"https://api.github.com/repos/bolshakov/active_model_serializers/hooks","issue_events_url":"https://api.github.com/repos/bolshakov/active_model_serializers/issues/events{/number}","events_url":"https://api.github.com/repos/bolshakov/active_model_serializers/events","assignees_url":"https://api.github.com/repos/bolshakov/active_model_serializers/assignees{/user}","branches_url":"https://api.github.com/repos/bolshakov/active_model_serializers/branches{/branch}","tags_url":"https://api.github.com/repos/bolshakov/active_model_serializers/tags","blobs_url":"https://api.github.com/repos/bolshakov/active_model_serializers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bolshakov/active_model_serializers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bolshakov/active_model_serializers/git/refs{/sha}","trees_url":"https://api.github.com/repos/bolshakov/active_model_serializers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bolshakov/active_model_serializers/statuses/{sha}","languages_url":"https://api.github.com/repos/bolshakov/active_model_serializers/languages","stargazers_url":"https://api.github.com/repos/bolshakov/active_model_serializers/stargazers","contributors_url":"https://api.github.com/repos/bolshakov/active_model_serializers/contributors","subscribers_url":"https://api.github.com/repos/bolshakov/active_model_serializers/subscribers","subscription_url":"https://api.github.com/repos/bolshakov/active_model_serializers/subscription","commits_url":"https://api.github.com/repos/bolshakov/active_model_serializers/commits{/sha}","git_commits_url":"https://api.github.com/repos/bolshakov/active_model_serializers/git/commits{/sha}","comments_url":"https://api.github.com/repos/bolshakov/active_model_serializers/comments{/number}","issue_comment_url":"https://api.github.com/repos/bolshakov/active_model_serializers/issues/comments{/number}","contents_url":"https://api.github.com/repos/bolshakov/active_model_serializers/contents/{+path}","compare_url":"https://api.github.com/repos/bolshakov/active_model_serializers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bolshakov/active_model_serializers/merges","archive_url":"https://api.github.com/repos/bolshakov/active_model_serializers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bolshakov/active_model_serializers/downloads","issues_url":"https://api.github.com/repos/bolshakov/active_model_serializers/issues{/number}","pulls_url":"https://api.github.com/repos/bolshakov/active_model_serializers/pulls{/number}","milestones_url":"https://api.github.com/repos/bolshakov/active_model_serializers/milestones{/number}","notifications_url":"https://api.github.com/repos/bolshakov/active_model_serializers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bolshakov/active_model_serializers/labels{/name}","releases_url":"https://api.github.com/repos/bolshakov/active_model_serializers/releases{/id}","created_at":"2014-08-18T08:31:19Z","updated_at":"2015-07-06T07:33:09Z","pushed_at":"2015-07-06T15:44:31Z","git_url":"git://github.com/bolshakov/active_model_serializers.git","ssh_url":"git@github.com:bolshakov/active_model_serializers.git","clone_url":"https://github.com/bolshakov/active_model_serializers.git","svn_url":"https://github.com/bolshakov/active_model_serializers","homepage":"","size":1216,"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:master","ref":"master","sha":"90fb1cf809dfa606181a1e047f30a05efe71912a","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}","created_at":"2011-12-01T06:39:26Z","updated_at":"2015-07-06T05:09:39Z","pushed_at":"2015-07-06T15:44:32Z","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":5267,"stargazers_count":2818,"watchers_count":2818,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":628,"mirror_url":null,"open_issues_count":128,"forks":628,"open_issues":128,"watchers":2818,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985"},"html":{"href":"https://github.com/rails-api/active_model_serializers/pull/985"},"issue":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/issues/985"},"comments":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/issues/985/comments"},"review_comments":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/pulls/985/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/985/commits"},"statuses":{"href":"https://api.github.com/repos/rails-api/active_model_serializers/statuses/0768d0422250771384c5fd5df736082fad00825a"}}}}