{"action":"created","comment":{"url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/comments/78171759","id":78171759,"diff_hunk":"@@ -0,0 +1,38 @@\n+class Team < ApplicationRecord\n+  has_many :user_teams\n+  has_many :members, through: :user_teams, source: :user, class_name: User\n+\n+  scope :related_to, -> (user_ids) do\n+    joins(:user_teams)\n+      .where(user_teams: { user_id: user_ids })\n+      .distinct\n+  end\n+\n+  validates_associated :user_teams\n+\n+  validates :name, presence: true, uniqueness: true\n+\n+  validate :unique_member_collections_for_teams\n+\n+  def member_ids","path":"app/models/team.rb","position":17,"original_position":17,"commit_id":"a9c600dfce07093a81586d541e9aeb7db9d6a5f7","original_commit_id":"a9c600dfce07093a81586d541e9aeb7db9d6a5f7","user":{"login":"monttda","id":5710815,"avatar_url":"https://avatars.githubusercontent.com/u/5710815?v=3","gravatar_id":"","url":"https://api.github.com/users/monttda","html_url":"https://github.com/monttda","followers_url":"https://api.github.com/users/monttda/followers","following_url":"https://api.github.com/users/monttda/following{/other_user}","gists_url":"https://api.github.com/users/monttda/gists{/gist_id}","starred_url":"https://api.github.com/users/monttda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monttda/subscriptions","organizations_url":"https://api.github.com/users/monttda/orgs","repos_url":"https://api.github.com/users/monttda/repos","events_url":"https://api.github.com/users/monttda/events{/privacy}","received_events_url":"https://api.github.com/users/monttda/received_events","type":"User","site_admin":false},"body":"this method should not exists  i see the method is only called in this_and_related_teams so why not just used the map there ?","created_at":"2016-09-09T12:33:42Z","updated_at":"2016-09-09T12:33:42Z","html_url":"https://github.com/pczarn/gameroom-task/pull/2#discussion_r78171759","pull_request_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/comments/78171759"},"html":{"href":"https://github.com/pczarn/gameroom-task/pull/2#discussion_r78171759"},"pull_request":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2","id":84625504,"html_url":"https://github.com/pczarn/gameroom-task/pull/2","diff_url":"https://github.com/pczarn/gameroom-task/pull/2.diff","patch_url":"https://github.com/pczarn/gameroom-task/pull/2.patch","issue_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/2","number":2,"state":"open","locked":false,"title":"Create the app backbone with models and seeds","user":{"login":"pczarn","id":3356767,"avatar_url":"https://avatars.githubusercontent.com/u/3356767?v=3","gravatar_id":"","url":"https://api.github.com/users/pczarn","html_url":"https://github.com/pczarn","followers_url":"https://api.github.com/users/pczarn/followers","following_url":"https://api.github.com/users/pczarn/following{/other_user}","gists_url":"https://api.github.com/users/pczarn/gists{/gist_id}","starred_url":"https://api.github.com/users/pczarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pczarn/subscriptions","organizations_url":"https://api.github.com/users/pczarn/orgs","repos_url":"https://api.github.com/users/pczarn/repos","events_url":"https://api.github.com/users/pczarn/events{/privacy}","received_events_url":"https://api.github.com/users/pczarn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-09T10:07:44Z","updated_at":"2016-09-09T12:33:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e027fce92de15262b2c3e8ca150e968587a14ddd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2/commits","review_comments_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2/comments","review_comment_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/2/comments","statuses_url":"https://api.github.com/repos/pczarn/gameroom-task/statuses/a9c600dfce07093a81586d541e9aeb7db9d6a5f7","head":{"label":"pczarn:create-app-models-seeds","ref":"create-app-models-seeds","sha":"a9c600dfce07093a81586d541e9aeb7db9d6a5f7","user":{"login":"pczarn","id":3356767,"avatar_url":"https://avatars.githubusercontent.com/u/3356767?v=3","gravatar_id":"","url":"https://api.github.com/users/pczarn","html_url":"https://github.com/pczarn","followers_url":"https://api.github.com/users/pczarn/followers","following_url":"https://api.github.com/users/pczarn/following{/other_user}","gists_url":"https://api.github.com/users/pczarn/gists{/gist_id}","starred_url":"https://api.github.com/users/pczarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pczarn/subscriptions","organizations_url":"https://api.github.com/users/pczarn/orgs","repos_url":"https://api.github.com/users/pczarn/repos","events_url":"https://api.github.com/users/pczarn/events{/privacy}","received_events_url":"https://api.github.com/users/pczarn/received_events","type":"User","site_admin":false},"repo":{"id":67398245,"name":"gameroom-task","full_name":"pczarn/gameroom-task","owner":{"login":"pczarn","id":3356767,"avatar_url":"https://avatars.githubusercontent.com/u/3356767?v=3","gravatar_id":"","url":"https://api.github.com/users/pczarn","html_url":"https://github.com/pczarn","followers_url":"https://api.github.com/users/pczarn/followers","following_url":"https://api.github.com/users/pczarn/following{/other_user}","gists_url":"https://api.github.com/users/pczarn/gists{/gist_id}","starred_url":"https://api.github.com/users/pczarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pczarn/subscriptions","organizations_url":"https://api.github.com/users/pczarn/orgs","repos_url":"https://api.github.com/users/pczarn/repos","events_url":"https://api.github.com/users/pczarn/events{/privacy}","received_events_url":"https://api.github.com/users/pczarn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pczarn/gameroom-task","description":"Our internal app for matchmaking in the game room. Work in progress.","fork":false,"url":"https://api.github.com/repos/pczarn/gameroom-task","forks_url":"https://api.github.com/repos/pczarn/gameroom-task/forks","keys_url":"https://api.github.com/repos/pczarn/gameroom-task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pczarn/gameroom-task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pczarn/gameroom-task/teams","hooks_url":"https://api.github.com/repos/pczarn/gameroom-task/hooks","issue_events_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/events{/number}","events_url":"https://api.github.com/repos/pczarn/gameroom-task/events","assignees_url":"https://api.github.com/repos/pczarn/gameroom-task/assignees{/user}","branches_url":"https://api.github.com/repos/pczarn/gameroom-task/branches{/branch}","tags_url":"https://api.github.com/repos/pczarn/gameroom-task/tags","blobs_url":"https://api.github.com/repos/pczarn/gameroom-task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pczarn/gameroom-task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pczarn/gameroom-task/git/refs{/sha}","trees_url":"https://api.github.com/repos/pczarn/gameroom-task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pczarn/gameroom-task/statuses/{sha}","languages_url":"https://api.github.com/repos/pczarn/gameroom-task/languages","stargazers_url":"https://api.github.com/repos/pczarn/gameroom-task/stargazers","contributors_url":"https://api.github.com/repos/pczarn/gameroom-task/contributors","subscribers_url":"https://api.github.com/repos/pczarn/gameroom-task/subscribers","subscription_url":"https://api.github.com/repos/pczarn/gameroom-task/subscription","commits_url":"https://api.github.com/repos/pczarn/gameroom-task/commits{/sha}","git_commits_url":"https://api.github.com/repos/pczarn/gameroom-task/git/commits{/sha}","comments_url":"https://api.github.com/repos/pczarn/gameroom-task/comments{/number}","issue_comment_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/comments{/number}","contents_url":"https://api.github.com/repos/pczarn/gameroom-task/contents/{+path}","compare_url":"https://api.github.com/repos/pczarn/gameroom-task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pczarn/gameroom-task/merges","archive_url":"https://api.github.com/repos/pczarn/gameroom-task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pczarn/gameroom-task/downloads","issues_url":"https://api.github.com/repos/pczarn/gameroom-task/issues{/number}","pulls_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls{/number}","milestones_url":"https://api.github.com/repos/pczarn/gameroom-task/milestones{/number}","notifications_url":"https://api.github.com/repos/pczarn/gameroom-task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pczarn/gameroom-task/labels{/name}","releases_url":"https://api.github.com/repos/pczarn/gameroom-task/releases{/id}","deployments_url":"https://api.github.com/repos/pczarn/gameroom-task/deployments","created_at":"2016-09-05T07:32:05Z","updated_at":"2016-09-09T08:00:52Z","pushed_at":"2016-09-09T11:42:54Z","git_url":"git://github.com/pczarn/gameroom-task.git","ssh_url":"git@github.com:pczarn/gameroom-task.git","clone_url":"https://github.com/pczarn/gameroom-task.git","svn_url":"https://github.com/pczarn/gameroom-task","homepage":"","size":102,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"pczarn:master","ref":"master","sha":"9f5bc72b51dd2f3f15cab2d1d865148bada8cd83","user":{"login":"pczarn","id":3356767,"avatar_url":"https://avatars.githubusercontent.com/u/3356767?v=3","gravatar_id":"","url":"https://api.github.com/users/pczarn","html_url":"https://github.com/pczarn","followers_url":"https://api.github.com/users/pczarn/followers","following_url":"https://api.github.com/users/pczarn/following{/other_user}","gists_url":"https://api.github.com/users/pczarn/gists{/gist_id}","starred_url":"https://api.github.com/users/pczarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pczarn/subscriptions","organizations_url":"https://api.github.com/users/pczarn/orgs","repos_url":"https://api.github.com/users/pczarn/repos","events_url":"https://api.github.com/users/pczarn/events{/privacy}","received_events_url":"https://api.github.com/users/pczarn/received_events","type":"User","site_admin":false},"repo":{"id":67398245,"name":"gameroom-task","full_name":"pczarn/gameroom-task","owner":{"login":"pczarn","id":3356767,"avatar_url":"https://avatars.githubusercontent.com/u/3356767?v=3","gravatar_id":"","url":"https://api.github.com/users/pczarn","html_url":"https://github.com/pczarn","followers_url":"https://api.github.com/users/pczarn/followers","following_url":"https://api.github.com/users/pczarn/following{/other_user}","gists_url":"https://api.github.com/users/pczarn/gists{/gist_id}","starred_url":"https://api.github.com/users/pczarn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pczarn/subscriptions","organizations_url":"https://api.github.com/users/pczarn/orgs","repos_url":"https://api.github.com/users/pczarn/repos","events_url":"https://api.github.com/users/pczarn/events{/privacy}","received_events_url":"https://api.github.com/users/pczarn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pczarn/gameroom-task","description":"Our internal app for matchmaking in the game room. Work in progress.","fork":false,"url":"https://api.github.com/repos/pczarn/gameroom-task","forks_url":"https://api.github.com/repos/pczarn/gameroom-task/forks","keys_url":"https://api.github.com/repos/pczarn/gameroom-task/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pczarn/gameroom-task/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pczarn/gameroom-task/teams","hooks_url":"https://api.github.com/repos/pczarn/gameroom-task/hooks","issue_events_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/events{/number}","events_url":"https://api.github.com/repos/pczarn/gameroom-task/events","assignees_url":"https://api.github.com/repos/pczarn/gameroom-task/assignees{/user}","branches_url":"https://api.github.com/repos/pczarn/gameroom-task/branches{/branch}","tags_url":"https://api.github.com/repos/pczarn/gameroom-task/tags","blobs_url":"https://api.github.com/repos/pczarn/gameroom-task/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pczarn/gameroom-task/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pczarn/gameroom-task/git/refs{/sha}","trees_url":"https://api.github.com/repos/pczarn/gameroom-task/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pczarn/gameroom-task/statuses/{sha}","languages_url":"https://api.github.com/repos/pczarn/gameroom-task/languages","stargazers_url":"https://api.github.com/repos/pczarn/gameroom-task/stargazers","contributors_url":"https://api.github.com/repos/pczarn/gameroom-task/contributors","subscribers_url":"https://api.github.com/repos/pczarn/gameroom-task/subscribers","subscription_url":"https://api.github.com/repos/pczarn/gameroom-task/subscription","commits_url":"https://api.github.com/repos/pczarn/gameroom-task/commits{/sha}","git_commits_url":"https://api.github.com/repos/pczarn/gameroom-task/git/commits{/sha}","comments_url":"https://api.github.com/repos/pczarn/gameroom-task/comments{/number}","issue_comment_url":"https://api.github.com/repos/pczarn/gameroom-task/issues/comments{/number}","contents_url":"https://api.github.com/repos/pczarn/gameroom-task/contents/{+path}","compare_url":"https://api.github.com/repos/pczarn/gameroom-task/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pczarn/gameroom-task/merges","archive_url":"https://api.github.com/repos/pczarn/gameroom-task/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pczarn/gameroom-task/downloads","issues_url":"https://api.github.com/repos/pczarn/gameroom-task/issues{/number}","pulls_url":"https://api.github.com/repos/pczarn/gameroom-task/pulls{/number}","milestones_url":"https://api.github.com/repos/pczarn/gameroom-task/milestones{/number}","notifications_url":"https://api.github.com/repos/pczarn/gameroom-task/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pczarn/gameroom-task/labels{/name}","releases_url":"https://api.github.com/repos/pczarn/gameroom-task/releases{/id}","deployments_url":"https://api.github.com/repos/pczarn/gameroom-task/deployments","created_at":"2016-09-05T07:32:05Z","updated_at":"2016-09-09T08:00:52Z","pushed_at":"2016-09-09T11:42:54Z","git_url":"git://github.com/pczarn/gameroom-task.git","ssh_url":"git@github.com:pczarn/gameroom-task.git","clone_url":"https://github.com/pczarn/gameroom-task.git","svn_url":"https://github.com/pczarn/gameroom-task","homepage":"","size":102,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2"},"html":{"href":"https://github.com/pczarn/gameroom-task/pull/2"},"issue":{"href":"https://api.github.com/repos/pczarn/gameroom-task/issues/2"},"comments":{"href":"https://api.github.com/repos/pczarn/gameroom-task/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pczarn/gameroom-task/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/pczarn/gameroom-task/statuses/a9c600dfce07093a81586d541e9aeb7db9d6a5f7"}}}}
{"actor":{"display_login":"monttda"}}