{"action":"created","comment":{"url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/comments/175175062","pull_request_review_id":104669685,"id":175175062,"diff_hunk":"@@ -1,40 +1,41 @@\n # frozen_string_literal: true\n \n class Features\n-  # This is for toggling Wiki Ed-specific features that should not be active\n-  # on any other dashboard instances.\n-  def self.wiki_ed?\n-    return true if ENV['dashboard_url'] == 'dashboard.wikiedu.org'\n-    return true if ENV['dashboard_url'] == 'dashboard-testing.wikiedu.org'\n-    false\n-  end\n+  # Add methods which you want to be true for the respective configurations\n \n-  def self.default_course_type\n-    ENV['default_course_type'] || 'ClassroomProgramCourse'\n-  end\n+  PE = %i[\n+    disable_help? disable_onboarding? wiki_trainings?\n+    enable_language_switcher? enable_account_requests?\n+    disable_wiki_output? enable_article_finder? open_course_creation?\n+  ].freeze\n \n-  def self.default_course_string_prefix\n-    default_course_type.constantize.new.string_prefix\n-  end\n+  WIKI_ED = %i[\n+    enable_get_help_button?\n+    wiki_ed?\n+  ].freeze\n \n-  def self.disable_onboarding?\n-    ENV['disable_onboarding'] == 'true'\n-  end\n+  is_ed = ENV['wiki_education'] == 'true'\n \n-  def self.disable_help?\n-    ENV['disable_help'] == 'true'\n+  PE.each do |method|\n+    define_singleton_method method do","path":"app/presenters/features.rb","position":38,"original_position":38,"commit_id":"3fc32bf8913871f03007949825b5b34e715d3e08","original_commit_id":"3fc32bf8913871f03007949825b5b34e715d3e08","user":{"login":"ragesoss","id":848483,"avatar_url":"https://avatars0.githubusercontent.com/u/848483?v=4","gravatar_id":"","url":"https://api.github.com/users/ragesoss","html_url":"https://github.com/ragesoss","followers_url":"https://api.github.com/users/ragesoss/followers","following_url":"https://api.github.com/users/ragesoss/following{/other_user}","gists_url":"https://api.github.com/users/ragesoss/gists{/gist_id}","starred_url":"https://api.github.com/users/ragesoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ragesoss/subscriptions","organizations_url":"https://api.github.com/users/ragesoss/orgs","repos_url":"https://api.github.com/users/ragesoss/repos","events_url":"https://api.github.com/users/ragesoss/events{/privacy}","received_events_url":"https://api.github.com/users/ragesoss/received_events","type":"User","site_admin":false},"body":"I would rather not do this with metaprogramming for this. Repeating `ENV['wiki_education'] == 'true'` isn't a big deal, and will keep the code extremely transparent.","created_at":"2018-03-16T18:15:42Z","updated_at":"2018-03-16T18:15:42Z","html_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806#discussion_r175175062","pull_request_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/comments/175175062"},"html":{"href":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806#discussion_r175175062"},"pull_request":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806"}}},"pull_request":{"url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806","id":175608164,"html_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806","diff_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806.diff","patch_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806.patch","issue_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/1806","number":1806,"state":"open","locked":false,"title":"Added fast switch option","user":{"login":"AmitJoki","id":5158554,"avatar_url":"https://avatars1.githubusercontent.com/u/5158554?v=4","gravatar_id":"","url":"https://api.github.com/users/AmitJoki","html_url":"https://github.com/AmitJoki","followers_url":"https://api.github.com/users/AmitJoki/followers","following_url":"https://api.github.com/users/AmitJoki/following{/other_user}","gists_url":"https://api.github.com/users/AmitJoki/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitJoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitJoki/subscriptions","organizations_url":"https://api.github.com/users/AmitJoki/orgs","repos_url":"https://api.github.com/users/AmitJoki/repos","events_url":"https://api.github.com/users/AmitJoki/events{/privacy}","received_events_url":"https://api.github.com/users/AmitJoki/received_events","type":"User","site_admin":false},"body":"Fixes #1804 \r\n\r\nUse in `application.yml`\r\n\r\n```\r\n  wiki_education: 'true'  # or false for P & E Dashboard\r\n```","created_at":"2018-03-16T18:08:23Z","updated_at":"2018-03-16T18:15:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4151563b45c292be5221ad4c426d669e2862e702","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806/commits","review_comments_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806/comments","review_comment_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/1806/comments","statuses_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/statuses/3fc32bf8913871f03007949825b5b34e715d3e08","head":{"label":"AmitJoki:One-Switch","ref":"One-Switch","sha":"3fc32bf8913871f03007949825b5b34e715d3e08","user":{"login":"AmitJoki","id":5158554,"avatar_url":"https://avatars1.githubusercontent.com/u/5158554?v=4","gravatar_id":"","url":"https://api.github.com/users/AmitJoki","html_url":"https://github.com/AmitJoki","followers_url":"https://api.github.com/users/AmitJoki/followers","following_url":"https://api.github.com/users/AmitJoki/following{/other_user}","gists_url":"https://api.github.com/users/AmitJoki/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitJoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitJoki/subscriptions","organizations_url":"https://api.github.com/users/AmitJoki/orgs","repos_url":"https://api.github.com/users/AmitJoki/repos","events_url":"https://api.github.com/users/AmitJoki/events{/privacy}","received_events_url":"https://api.github.com/users/AmitJoki/received_events","type":"User","site_admin":false},"repo":{"id":120386114,"name":"WikiEduDashboard","full_name":"AmitJoki/WikiEduDashboard","owner":{"login":"AmitJoki","id":5158554,"avatar_url":"https://avatars1.githubusercontent.com/u/5158554?v=4","gravatar_id":"","url":"https://api.github.com/users/AmitJoki","html_url":"https://github.com/AmitJoki","followers_url":"https://api.github.com/users/AmitJoki/followers","following_url":"https://api.github.com/users/AmitJoki/following{/other_user}","gists_url":"https://api.github.com/users/AmitJoki/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitJoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitJoki/subscriptions","organizations_url":"https://api.github.com/users/AmitJoki/orgs","repos_url":"https://api.github.com/users/AmitJoki/repos","events_url":"https://api.github.com/users/AmitJoki/events{/privacy}","received_events_url":"https://api.github.com/users/AmitJoki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AmitJoki/WikiEduDashboard","description":"Wiki Education Foundation's Wikipedia course dashboard system","fork":true,"url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard","forks_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/forks","keys_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/teams","hooks_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/hooks","issue_events_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/issues/events{/number}","events_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/events","assignees_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/assignees{/user}","branches_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/branches{/branch}","tags_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/tags","blobs_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/languages","stargazers_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/stargazers","contributors_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/contributors","subscribers_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/subscribers","subscription_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/subscription","commits_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/contents/{+path}","compare_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/merges","archive_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/downloads","issues_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/issues{/number}","pulls_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/labels{/name}","releases_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/releases{/id}","deployments_url":"https://api.github.com/repos/AmitJoki/WikiEduDashboard/deployments","created_at":"2018-02-06T01:43:15Z","updated_at":"2018-03-16T15:38:28Z","pushed_at":"2018-03-16T18:06:43Z","git_url":"git://github.com/AmitJoki/WikiEduDashboard.git","ssh_url":"git@github.com:AmitJoki/WikiEduDashboard.git","clone_url":"https://github.com/AmitJoki/WikiEduDashboard.git","svn_url":"https://github.com/AmitJoki/WikiEduDashboard","homepage":"https://dashboard.wikiedu.org","size":66409,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WikiEducationFoundation:master","ref":"master","sha":"6e8fed91cb903378f51be60f91e8e25cbda88be6","user":{"login":"WikiEducationFoundation","id":9489865,"avatar_url":"https://avatars1.githubusercontent.com/u/9489865?v=4","gravatar_id":"","url":"https://api.github.com/users/WikiEducationFoundation","html_url":"https://github.com/WikiEducationFoundation","followers_url":"https://api.github.com/users/WikiEducationFoundation/followers","following_url":"https://api.github.com/users/WikiEducationFoundation/following{/other_user}","gists_url":"https://api.github.com/users/WikiEducationFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiEducationFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiEducationFoundation/subscriptions","organizations_url":"https://api.github.com/users/WikiEducationFoundation/orgs","repos_url":"https://api.github.com/users/WikiEducationFoundation/repos","events_url":"https://api.github.com/users/WikiEducationFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/WikiEducationFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":27940263,"name":"WikiEduDashboard","full_name":"WikiEducationFoundation/WikiEduDashboard","owner":{"login":"WikiEducationFoundation","id":9489865,"avatar_url":"https://avatars1.githubusercontent.com/u/9489865?v=4","gravatar_id":"","url":"https://api.github.com/users/WikiEducationFoundation","html_url":"https://github.com/WikiEducationFoundation","followers_url":"https://api.github.com/users/WikiEducationFoundation/followers","following_url":"https://api.github.com/users/WikiEducationFoundation/following{/other_user}","gists_url":"https://api.github.com/users/WikiEducationFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiEducationFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiEducationFoundation/subscriptions","organizations_url":"https://api.github.com/users/WikiEducationFoundation/orgs","repos_url":"https://api.github.com/users/WikiEducationFoundation/repos","events_url":"https://api.github.com/users/WikiEducationFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/WikiEducationFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard","description":"Wiki Education Foundation's Wikipedia course dashboard system","fork":false,"url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard","forks_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/forks","keys_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/teams","hooks_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/hooks","issue_events_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/events{/number}","events_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/events","assignees_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/assignees{/user}","branches_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/branches{/branch}","tags_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/tags","blobs_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/languages","stargazers_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/stargazers","contributors_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/contributors","subscribers_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/subscribers","subscription_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/subscription","commits_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/contents/{+path}","compare_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/merges","archive_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/downloads","issues_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues{/number}","pulls_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/labels{/name}","releases_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/releases{/id}","deployments_url":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/deployments","created_at":"2014-12-12T22:13:19Z","updated_at":"2018-03-16T16:26:09Z","pushed_at":"2018-03-16T18:11:30Z","git_url":"git://github.com/WikiEducationFoundation/WikiEduDashboard.git","ssh_url":"git@github.com:WikiEducationFoundation/WikiEduDashboard.git","clone_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard.git","svn_url":"https://github.com/WikiEducationFoundation/WikiEduDashboard","homepage":"https://dashboard.wikiedu.org","size":66339,"stargazers_count":86,"watchers_count":86,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"archived":false,"open_issues_count":203,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":170,"open_issues":203,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806"},"html":{"href":"https://github.com/WikiEducationFoundation/WikiEduDashboard/pull/1806"},"issue":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/1806"},"comments":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/issues/1806/comments"},"review_comments":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806/comments"},"review_comment":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/pulls/1806/commits"},"statuses":{"href":"https://api.github.com/repos/WikiEducationFoundation/WikiEduDashboard/statuses/3fc32bf8913871f03007949825b5b34e715d3e08"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ragesoss"}}