Only Enable Hypershield if ENV variable is present (#6666) [deploy]

* only enable hypershield if ENV variable is present

* enable hypershield if in production
This commit is contained in:
Molly Struve 2020-03-16 15:28:46 -04:00 committed by GitHub
parent 1d9c8a8e11
commit 066e2885e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,8 @@
# further setup instructions: https://github.com/ankane/hypershield#database-setup
if Rails.env.production?
Hypershield.enabled = ENV["ENABLE_HYPERSHIELD"].present?
# Validate that hypershield schema exists before trying to use it
begin
if ActiveRecord::Base.connection.schema_exists?("hypershield")