Return from method if env called in boot up not available (#11736)

This commit is contained in:
Ben Halpern 2020-12-03 16:27:13 -05:00 committed by GitHub
parent d9011f4b59
commit a1b9336505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ class Profile < ApplicationRecord
# Generates typed accessors for all currently defined profile fields.
def self.refresh_attributes!
return if ENV["ENV_AVAILABLE"] == "false"
return unless Database.table_exists?("profiles")
ProfileField.find_each do |field|