Skip to content

Commit

Permalink
fix: ensure Account is an ActiveRecord model before generating Avo re…
Browse files Browse the repository at this point in the history
…source (#2579)
  • Loading branch information
gabrielgiroe1 authored Mar 13, 2024
1 parent 79e1fa8 commit 37767fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators/avo/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37767fe

Please sign in to comment.