Merge branch 'sh-fix-generators-not-always-working' into 'master'

Fix "rails g migration" not always using migration templates

Closes #52651

See merge request gitlab-org/gitlab-ce!22592
This commit is contained in:
Robert Speicher 2018-11-01 22:51:31 +00:00
commit 8fab37e3cd
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ end
# check: https://github.com/rspec/rspec-mocks#settings-mocks-or-stubs-on-any-instance-of-a-class
#
# Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/33587
if Gitlab::Metrics.enabled? && !Rails.env.test?
#
# In development mode, we turn off eager loading when we're running
# `rails generate migration` because eager loading short-circuits the
# loading of our custom migration templates.
if Gitlab::Metrics.enabled? && !Rails.env.test? && !(Rails.env.development? && defined?(Rails::Generators))
require 'pathname'
require 'influxdb'
require 'connection_pool'