summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-10-24 16:33:19 -0700
committerStan Hu <stanhu@gmail.com>2018-10-25 14:09:27 -0700
commit76c8041b9a496959df7310b7b9be8c908e768314 (patch)
tree5943762fa3e9d14921d97c1f3eb72c88e05bc95c /lib
parentf5d71ad8f3d1899a29bc12c4fcc8847b14195e3a (diff)
downloadgitlab-ce-76c8041b9a496959df7310b7b9be8c908e768314.tar.gz
Fix "rails g migration" not always using migration templatessh-fix-generators-not-always-working
Normally, this is what's supposed to happen when you invoke `rails g generate migration`: 1. `Rails.application.load_generators` is called here: https://github.com/rails/rails/blob/v4.2.10/railties/lib/rails/commands/commands_tasks.rb#L129 2. This loads the local `generator_templates` path in https://github.com/rails/rails/blob/v4.2.10/railties/lib/rails/generators.rb#L69. However, when metrics are enabled, the application is eager loaded here in the initializer. This short-circuits the `load_generators` and loads `ActiveRecord::Generators::MigrationGenerator` automatically, so the custom path is never loaded properly. With this change, we skip the initializing of metrics and eager loading if generators are in use. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52651
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions