diff options
author | Robert Speicher <robert@gitlab.com> | 2018-11-01 22:51:31 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-11-01 22:51:31 +0000 |
commit | 8fab37e3cd02cd7441229f6d20db4e9bf93f2a21 (patch) | |
tree | 0693cbfad7c782b38f92c280f498e829b4092a8b /config/initializers/8_metrics.rb | |
parent | 795c0e3522b6291eaac2f2da90fa75c7304c4c81 (diff) | |
parent | 76c8041b9a496959df7310b7b9be8c908e768314 (diff) | |
download | gitlab-ce-8fab37e3cd02cd7441229f6d20db4e9bf93f2a21.tar.gz |
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
Diffstat (limited to 'config/initializers/8_metrics.rb')
-rw-r--r-- | config/initializers/8_metrics.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index c8d261d415e..468f80939d7 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -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' |