Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate fails with: "NoMethodError: undefined method `name' for nil:NilClass" #356

Open
alec-implicitdesign opened this issue Jun 29, 2020 · 4 comments

Comments

@alec-implicitdesign
Copy link

I can't really make out what is causing it to fail. I saw a similar issue in #303, but I don't see any mention paper-trail in the output here.

$ bundle exec rails db:migrate
...
NoMethodError: undefined method `name' for nil:NilClass
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:102:in `block (2 levels) in relationships_mapping'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:100:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:100:in `block in relationships_mapping'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:99:in `tap'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:99:in `relationships_mapping'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain.rb:77:in `relationships_by_entity_name'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain/attribute.rb:80:in `foreign_key?'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/domain/attribute.rb:58:in `content?'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:207:in `block (2 levels) in filtered_attributes'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:207:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:207:in `none?'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:207:in `block in filtered_attributes'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:204:in `reject'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:204:in `filtered_attributes'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:136:in `block in generate'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:135:in `each'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:135:in `generate'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:119:in `create'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/diagram.rb:74:in `create'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/rails_erd/tasks.rake:61:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bugsnag-6.11.1/lib/bugsnag/integrations/rake.rb:18:in `execute_with_bugsnag'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/tasks/auto_generate_diagram.rake:18:in `update_model'
/app/vendor/bundle/ruby/2.5.0/gems/rails-erd-1.6.0/lib/tasks/auto_generate_diagram.rake:3:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bugsnag-6.11.1/lib/bugsnag/integrations/rake.rb:18:in `execute_with_bugsnag'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
bin/rails:9:in `<main>'
Tasks: TOP => erd => erd:generate

@vaibhav8186
Copy link

Yes. I am getting the same error. while doing - rake erd

@sschroed
Copy link

+1

@nguyenduyta-raksul
Copy link

I think you don't have a versions table. Follow the below example. You need to define ApplicationVersion with abstract_class
https://github.com/paper-trail-gem/paper_trail#configuration

@dmuneras
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants