From 9429da3ae2d118ca1edcc20e992d0b2863cadeed Mon Sep 17 00:00:00 2001
From: Yorick Peterse <yorickpeterse@gmail.com>
Date: Thu, 19 May 2016 14:58:35 -0500
Subject: [PATCH] Move generator templates to generator_templates/

Since we eager load everything in lib/ putting ERB code in .rb files
will result in syntax errors. By moving the templates to
./generator_templates we can work around this.
---
 config/application.rb                                         | 4 +++-
 .../active_record/migration/create_table_migration.rb         | 0
 .../active_record/migration/migration.rb                      | 0
 3 files changed, 3 insertions(+), 1 deletion(-)
 rename {lib/templates => generator_templates}/active_record/migration/create_table_migration.rb (100%)
 rename {lib/templates => generator_templates}/active_record/migration/migration.rb (100%)

diff --git a/config/application.rb b/config/application.rb
index cba80f38f1f..06114bf34ee 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -26,6 +26,8 @@ module Gitlab
                                      #{config.root}/app/models/members
                                      #{config.root}/app/models/project_services))
 
+    config.generators.templates.push("#{config.root}/generator_templates")
+
     # Only load the plugins named here, in the order given (default is alphabetical).
     # :all can be used as a placeholder for all plugins not explicitly named.
     # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
@@ -39,7 +41,7 @@ module Gitlab
     config.encoding = "utf-8"
 
     # Configure sensitive parameters which will be filtered from the log file.
-    # 
+    #
     # Parameters filtered:
     # - Password (:password, :password_confirmation)
     # - Private tokens (:private_token)
diff --git a/lib/templates/active_record/migration/create_table_migration.rb b/generator_templates/active_record/migration/create_table_migration.rb
similarity index 100%
rename from lib/templates/active_record/migration/create_table_migration.rb
rename to generator_templates/active_record/migration/create_table_migration.rb
diff --git a/lib/templates/active_record/migration/migration.rb b/generator_templates/active_record/migration/migration.rb
similarity index 100%
rename from lib/templates/active_record/migration/migration.rb
rename to generator_templates/active_record/migration/migration.rb
-- 
GitLab