From 37767fe58f3c44cd8ae696e34ccf47382c3f16a3 Mon Sep 17 00:00:00 2001 From: Gabi <83423182+gabrielgiroe1@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:52:12 +0200 Subject: [PATCH] fix: ensure Account is an ActiveRecord model before generating Avo resource (#2579) --- lib/generators/avo/install_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators/avo/install_generator.rb b/lib/generators/avo/install_generator.rb index 9f6454c9e8..cf22ec63c6 100644 --- a/lib/generators/avo/install_generator.rb +++ b/lib/generators/avo/install_generator.rb @@ -21,7 +21,7 @@ def create_resources Rails::Generators.invoke("avo:resource", ["user", "-q"], {destination_root: Rails.root }) end - if defined?(Account).present? + if defined?(Account) && Account.is_a?(ActiveRecord::Base) Rails::Generators.invoke("avo:resource", ["account", "-q"], {destination_root: Rails.root }) end end