From 87858156bf2787b8cf6bc6954a51b5f6134f8165 Mon Sep 17 00:00:00 2001 From: hkdnet Date: Mon, 28 May 2018 00:51:11 +0900 Subject: [PATCH] Guard clause for top-level constant, ActiveRecord Sorcery::Generators::InstallGenerator::ActiveRecord is not defined and the purpose of this guard is to know whether orm is ActiveRecord or not. Therefore, return early when top-level ActiveRecord is not defined. --- lib/generators/sorcery/install_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/sorcery/install_generator.rb b/lib/generators/sorcery/install_generator.rb index 8c9db77b..b03171bb 100644 --- a/lib/generators/sorcery/install_generator.rb +++ b/lib/generators/sorcery/install_generator.rb @@ -61,7 +61,7 @@ def inject_sorcery_to_model # Copy the migrations files to db/migrate folder def copy_migration_files # Copy core migration file in all cases except when you pass --only-submodules. - return unless defined?(Sorcery::Generators::InstallGenerator::ActiveRecord) + return unless defined?(ActiveRecord) migration_template 'migration/core.rb', 'db/migrate/sorcery_core.rb', migration_class_name: migration_class_name unless only_submodules? if submodules