{"action":"created","comment":{"url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/comments/70672196","id":70672196,"diff_hunk":"@@ -45,18 +45,23 @@ def visible\n     end\n \n     # Returns a base scope reflecting the relevant teams depending on what\n-    # phase of the running season we're currently in.\n+    # phase of the running season we're currentin_ly in.\n     def by_season_phase\n       if Time.now.utc > Season.current.acceptance_notification_at\n-        Team.where season: Season.current, kind: %w(sponsored voluntary)\n+        Team.in_current_season.selected\n       else\n-        Team.visible.where season: Season.current\n+        Team.in_current_season.visible\n       end\n     end\n \n-    def active_teams\n-      Team.where(season: Season.current, kind: %w(sponsored voluntary)).order(:name)\n+    def in_current_season","path":"app/models/team.rb","position":null,"original_position":18,"commit_id":"34c330aacbf5ad2a57b8845d215f414d4786a1b5","original_commit_id":"7dc64bac276c5ecf080bd1ea29adf83196295765","user":{"login":"carpodaster","id":164400,"avatar_url":"https://avatars.githubusercontent.com/u/164400?v=3","gravatar_id":"","url":"https://api.github.com/users/carpodaster","html_url":"https://github.com/carpodaster","followers_url":"https://api.github.com/users/carpodaster/followers","following_url":"https://api.github.com/users/carpodaster/following{/other_user}","gists_url":"https://api.github.com/users/carpodaster/gists{/gist_id}","starred_url":"https://api.github.com/users/carpodaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carpodaster/subscriptions","organizations_url":"https://api.github.com/users/carpodaster/orgs","repos_url":"https://api.github.com/users/carpodaster/repos","events_url":"https://api.github.com/users/carpodaster/events{/privacy}","received_events_url":"https://api.github.com/users/carpodaster/received_events","type":"User","site_admin":false},"body":"The concrete name »current« is not a Rails convention, but re-using method names on different classes (when the expected behaviour is the same or at least similar) is a _Ruby_ convention. Ruby focusses heavily on the idea of _duck typing_ – meaning it doesn't really care _what_ it is as long as it responds to a certain method.\r\n\r\nBut I understand what you mean, and the name `current` is totally up for debate.\r\n\r\nWhat I suggest: let's stick with `current` in this PR. A follow-up PR can refactor all definitions of `current` (and its relevant factory traits) to `in_current_season`. It's a longer method name, but it totally reveals its intention. And that's way better! What do you think?","created_at":"2016-07-13T17:38:02Z","updated_at":"2016-07-13T17:38:02Z","html_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493#discussion_r70672196","pull_request_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493","_links":{"self":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/comments/70672196"},"html":{"href":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493#discussion_r70672196"},"pull_request":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493"}}},"pull_request":{"url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493","id":77114238,"html_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493","diff_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493.diff","patch_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493.patch","issue_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/493","number":493,"state":"open","locked":false,"title":"Show relevant teams only in dropdown menu","user":{"login":"F3PiX","id":6314687,"avatar_url":"https://avatars.githubusercontent.com/u/6314687?v=3","gravatar_id":"","url":"https://api.github.com/users/F3PiX","html_url":"https://github.com/F3PiX","followers_url":"https://api.github.com/users/F3PiX/followers","following_url":"https://api.github.com/users/F3PiX/following{/other_user}","gists_url":"https://api.github.com/users/F3PiX/gists{/gist_id}","starred_url":"https://api.github.com/users/F3PiX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F3PiX/subscriptions","organizations_url":"https://api.github.com/users/F3PiX/orgs","repos_url":"https://api.github.com/users/F3PiX/repos","events_url":"https://api.github.com/users/F3PiX/events{/privacy}","received_events_url":"https://api.github.com/users/F3PiX/received_events","type":"User","site_admin":false},"body":"Solves #485 \r\n\r\nFrom the day the acceptance letters are sent through the coding summer, only selected teams will turn up in the user profile editor (for orga's only). \r\nPlus some refactored Team.scopes\r\n","created_at":"2016-07-12T12:51:47Z","updated_at":"2016-07-13T17:38:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6db426d865dcb707ccdc63432080572002f96dd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493/commits","review_comments_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493/comments","review_comment_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/493/comments","statuses_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/statuses/34c330aacbf5ad2a57b8845d215f414d4786a1b5","head":{"label":"TeamCheesy:UserTeamsSelect","ref":"UserTeamsSelect","sha":"34c330aacbf5ad2a57b8845d215f414d4786a1b5","user":{"login":"TeamCheesy","id":12716832,"avatar_url":"https://avatars.githubusercontent.com/u/12716832?v=3","gravatar_id":"","url":"https://api.github.com/users/TeamCheesy","html_url":"https://github.com/TeamCheesy","followers_url":"https://api.github.com/users/TeamCheesy/followers","following_url":"https://api.github.com/users/TeamCheesy/following{/other_user}","gists_url":"https://api.github.com/users/TeamCheesy/gists{/gist_id}","starred_url":"https://api.github.com/users/TeamCheesy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeamCheesy/subscriptions","organizations_url":"https://api.github.com/users/TeamCheesy/orgs","repos_url":"https://api.github.com/users/TeamCheesy/repos","events_url":"https://api.github.com/users/TeamCheesy/events{/privacy}","received_events_url":"https://api.github.com/users/TeamCheesy/received_events","type":"Organization","site_admin":false},"repo":{"id":38422803,"name":"rgsoc-teams","full_name":"TeamCheesy/rgsoc-teams","owner":{"login":"TeamCheesy","id":12716832,"avatar_url":"https://avatars.githubusercontent.com/u/12716832?v=3","gravatar_id":"","url":"https://api.github.com/users/TeamCheesy","html_url":"https://github.com/TeamCheesy","followers_url":"https://api.github.com/users/TeamCheesy/followers","following_url":"https://api.github.com/users/TeamCheesy/following{/other_user}","gists_url":"https://api.github.com/users/TeamCheesy/gists{/gist_id}","starred_url":"https://api.github.com/users/TeamCheesy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeamCheesy/subscriptions","organizations_url":"https://api.github.com/users/TeamCheesy/orgs","repos_url":"https://api.github.com/users/TeamCheesy/repos","events_url":"https://api.github.com/users/TeamCheesy/events{/privacy}","received_events_url":"https://api.github.com/users/TeamCheesy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TeamCheesy/rgsoc-teams","description":"Teams management and activity ","fork":true,"url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams","forks_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/forks","keys_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/teams","hooks_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/hooks","issue_events_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/issues/events{/number}","events_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/events","assignees_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/assignees{/user}","branches_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/branches{/branch}","tags_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/tags","blobs_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/git/refs{/sha}","trees_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/statuses/{sha}","languages_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/languages","stargazers_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/stargazers","contributors_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/contributors","subscribers_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/subscribers","subscription_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/subscription","commits_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/commits{/sha}","git_commits_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/git/commits{/sha}","comments_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/comments{/number}","issue_comment_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/issues/comments{/number}","contents_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/contents/{+path}","compare_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/merges","archive_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/downloads","issues_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/issues{/number}","pulls_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/pulls{/number}","milestones_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/milestones{/number}","notifications_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/labels{/name}","releases_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/releases{/id}","deployments_url":"https://api.github.com/repos/TeamCheesy/rgsoc-teams/deployments","created_at":"2015-07-02T09:11:44Z","updated_at":"2016-02-08T17:43:30Z","pushed_at":"2016-07-13T16:29:03Z","git_url":"git://github.com/TeamCheesy/rgsoc-teams.git","ssh_url":"git@github.com:TeamCheesy/rgsoc-teams.git","clone_url":"https://github.com/TeamCheesy/rgsoc-teams.git","svn_url":"https://github.com/TeamCheesy/rgsoc-teams","homepage":null,"size":3629,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"rails-girls-summer-of-code:master","ref":"master","sha":"1b9c7d0b760b44813902f36028df161d1c0f739c","user":{"login":"rails-girls-summer-of-code","id":4704447,"avatar_url":"https://avatars.githubusercontent.com/u/4704447?v=3","gravatar_id":"","url":"https://api.github.com/users/rails-girls-summer-of-code","html_url":"https://github.com/rails-girls-summer-of-code","followers_url":"https://api.github.com/users/rails-girls-summer-of-code/followers","following_url":"https://api.github.com/users/rails-girls-summer-of-code/following{/other_user}","gists_url":"https://api.github.com/users/rails-girls-summer-of-code/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-girls-summer-of-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-girls-summer-of-code/subscriptions","organizations_url":"https://api.github.com/users/rails-girls-summer-of-code/orgs","repos_url":"https://api.github.com/users/rails-girls-summer-of-code/repos","events_url":"https://api.github.com/users/rails-girls-summer-of-code/events{/privacy}","received_events_url":"https://api.github.com/users/rails-girls-summer-of-code/received_events","type":"Organization","site_admin":false},"repo":{"id":10705327,"name":"rgsoc-teams","full_name":"rails-girls-summer-of-code/rgsoc-teams","owner":{"login":"rails-girls-summer-of-code","id":4704447,"avatar_url":"https://avatars.githubusercontent.com/u/4704447?v=3","gravatar_id":"","url":"https://api.github.com/users/rails-girls-summer-of-code","html_url":"https://github.com/rails-girls-summer-of-code","followers_url":"https://api.github.com/users/rails-girls-summer-of-code/followers","following_url":"https://api.github.com/users/rails-girls-summer-of-code/following{/other_user}","gists_url":"https://api.github.com/users/rails-girls-summer-of-code/gists{/gist_id}","starred_url":"https://api.github.com/users/rails-girls-summer-of-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails-girls-summer-of-code/subscriptions","organizations_url":"https://api.github.com/users/rails-girls-summer-of-code/orgs","repos_url":"https://api.github.com/users/rails-girls-summer-of-code/repos","events_url":"https://api.github.com/users/rails-girls-summer-of-code/events{/privacy}","received_events_url":"https://api.github.com/users/rails-girls-summer-of-code/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams","description":"Teams management and activity ","fork":false,"url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams","forks_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/forks","keys_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/teams","hooks_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/hooks","issue_events_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/events{/number}","events_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/events","assignees_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/assignees{/user}","branches_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/branches{/branch}","tags_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/tags","blobs_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/statuses/{sha}","languages_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/languages","stargazers_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/stargazers","contributors_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/contributors","subscribers_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/subscribers","subscription_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/subscription","commits_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/contents/{+path}","compare_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/merges","archive_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/downloads","issues_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues{/number}","pulls_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls{/number}","milestones_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/milestones{/number}","notifications_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/labels{/name}","releases_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/releases{/id}","deployments_url":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/deployments","created_at":"2013-06-15T11:13:22Z","updated_at":"2016-06-19T06:10:42Z","pushed_at":"2016-07-13T16:29:04Z","git_url":"git://github.com/rails-girls-summer-of-code/rgsoc-teams.git","ssh_url":"git@github.com:rails-girls-summer-of-code/rgsoc-teams.git","clone_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams.git","svn_url":"https://github.com/rails-girls-summer-of-code/rgsoc-teams","homepage":"https://teams.railsgirlssummerofcode.org","size":4900,"stargazers_count":24,"watchers_count":24,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":48,"forks":56,"open_issues":48,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493"},"html":{"href":"https://github.com/rails-girls-summer-of-code/rgsoc-teams/pull/493"},"issue":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/493"},"comments":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/issues/493/comments"},"review_comments":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493/comments"},"review_comment":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/pulls/493/commits"},"statuses":{"href":"https://api.github.com/repos/rails-girls-summer-of-code/rgsoc-teams/statuses/34c330aacbf5ad2a57b8845d215f414d4786a1b5"}}}}
{"actor":{"display_login":"carpodaster"}}