From 08efe8f3b22db9aa35f8f07763b17d4d15114c8b Mon Sep 17 00:00:00 2001 From: Hopper Gee Date: Mon, 4 Oct 2021 23:30:48 +0800 Subject: [PATCH] Add require 'multi_tenant_support' to initializer file --- lib/generators/multi_tenant_support/templates/initializer.rb.tt | 2 ++ test/generators/initializer_generator_test.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/generators/multi_tenant_support/templates/initializer.rb.tt b/lib/generators/multi_tenant_support/templates/initializer.rb.tt index fd5177c..9316c13 100644 --- a/lib/generators/multi_tenant_support/templates/initializer.rb.tt +++ b/lib/generators/multi_tenant_support/templates/initializer.rb.tt @@ -1,3 +1,5 @@ +require 'multi_tenant_support' + MultiTenantSupport.configure do model do |config| config.tenant_account_class_name = 'REPLACE_ME' diff --git a/test/generators/initializer_generator_test.rb b/test/generators/initializer_generator_test.rb index 148a6b6..65fc071 100644 --- a/test/generators/initializer_generator_test.rb +++ b/test/generators/initializer_generator_test.rb @@ -11,6 +11,8 @@ class InitializerGeneratorTest < Rails::Generators::TestCase run_generator initializer_file_content = File.read("#{destination_root}/config/initializers/multi_tenant_support.rb") expected_content = <<~INITIALIZER + require 'multi_tenant_support' + MultiTenantSupport.configure do model do |config| config.tenant_account_class_name = 'REPLACE_ME'