From 51ff6f302ac669370e4636e8f3a6baa22a9c13fe Mon Sep 17 00:00:00 2001 From: Zee <50284+zspencer@users.noreply.github.com> Date: Sun, 25 Jun 2023 11:40:21 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20`Neighborhood`:=20Get=20rid=20of?= =?UTF-8?q?=20unused=20`Feature`=20model=20(#1594)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Neighborhood`: Get rid of unused `Feature` model - https://github.com/zinc-collective/convene/issues/892 We used this early on to provide a degree of feature flagging; but we haven't used it lately and we will probably want to rely on `flippa` or something more fully featured and better maintained as we mature. --- .env.example | 3 --- app.json | 4 ---- app/models/feature.rb | 13 ------------- spec/models/feature_spec.rb | 12 ------------ 4 files changed, 32 deletions(-) delete mode 100644 app/models/feature.rb delete mode 100644 spec/models/feature_spec.rb diff --git a/.env.example b/.env.example index db5f98326..8ded20e56 100644 --- a/.env.example +++ b/.env.example @@ -3,9 +3,6 @@ # AWS_S3_SECRET_ACCESS_KEY= # AWS_S3_BUCKET= -FEATURE_SYSTEM_TEST=true -FEATURE_INVITATION=true - # If you are using docker to manage your postgresql database, # you will want to uncomment these # PGHOST=localhost diff --git a/app.json b/app.json index cfd9dd1d2..2872f4930 100644 --- a/app.json +++ b/app.json @@ -38,10 +38,6 @@ } }, "env": { - "FEATURE_SYSTEM_TEST": { - "description": "Seed Test data", - "value": "true" - }, "LOCKBOX_MASTER_KEY": { "description": "Encrypts data within the database", "generator": "secret" diff --git a/app/models/feature.rb b/app/models/feature.rb deleted file mode 100644 index 0bb78b0fb..000000000 --- a/app/models/feature.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -# An internal Microlibrary for feature flagging to help avoid -# sprinkling `ENV` calls throughout the codebase. -class Feature - # @param [String, #to_s] feature Name of the feature we're flagging - # @return [TrueClass, FalseClass] - def self.enabled?(feature) - feature = feature.to_s if feature.respond_to?(:to_s) - - ENV.fetch("FEATURE_#{feature.upcase}", "false") == "true" - end -end diff --git a/spec/models/feature_spec.rb b/spec/models/feature_spec.rb deleted file mode 100644 index 88d24f308..000000000 --- a/spec/models/feature_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "rails_helper" -RSpec.describe Feature do - subject(:feature) { described_class } - - describe ".enabled?(feature_name)" do - before { stub_const("ENV", "FEATURE_FOO" => "true", "FEATURE_BAR" => "yes") } - - it { is_expected.to be_enabled(:foo) } - it { is_expected.not_to be_enabled(:bar) } - it { is_expected.not_to be_enabled(:baz) } - end -end