lib/generators/avo/install_generator.rb in avo-2.32.4 vs lib/generators/avo/install_generator.rb in avo-2.32.5

- old
+ new

@@ -12,9 +12,20 @@ def create_initializer_file route "mount Avo::Engine, at: Avo.configuration.root_path" template "initializer/avo.tt", "config/initializers/avo.rb" directory File.join(__dir__, "templates", "locales"), "config/locales" + create_resources + end + + def create_resources + if defined?(User).present? + Rails::Generators.invoke("avo:resource", ["user", "-q"], {destination_root: Rails.root }) + end + + if defined?(Account).present? + Rails::Generators.invoke("avo:resource", ["account", "-q"], {destination_root: Rails.root }) + end end end end end