Unable to Use ERD Gem with Solidus Due to "undefined method `preference' for..." #4578
Replies: 3 comments
-
Can you please run it with |
Beta Was this translation helpful? Give feedback.
-
@kennyadsl This is the output from running with ➜ ttv-api git:(master) ✗ bundle exec rails db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke db:load_config
** Execute db:schema:dump
** Invoke erd (first_time)
** Invoke erd:generate (first_time)
** Invoke erd:check_dependencies (first_time)
** Execute erd:check_dependencies
** Invoke erd:options (first_time)
** Execute erd:options
** Invoke erd:load_models (first_time)
** Execute erd:load_models
Loading application environment...
** Invoke environment
Loading code in search of Active Record models...
rails aborted!
NoMethodError: undefined method `preference' for #<Class:0x00007ff7c9e497b0>
Did you mean? references
presence
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activerecord-5.2.4.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/solidus_core-2.10.1/app/models/spree/billing_integration.rb:7:in `<class:BillingIntegration>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/solidus_core-2.10.1/app/models/spree/billing_integration.rb:4:in `<module:Spree>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/solidus_core-2.10.1/app/models/spree/billing_integration.rb:3:in `<top (required)>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:476:in `load'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:476:in `block in load_file'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:661:in `new_constants_in'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:475:in `load_file'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:373:in `block in require_or_load'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:37:in `block in load_interlock'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:13:in `loading'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:37:in `load_interlock'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:356:in `require_or_load'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:334:in `depend_on'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:246:in `require_dependency'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:477:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:477:in `block in eager_load!'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:475:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:475:in `eager_load!'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/engine.rb:356:in `eager_load!'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rails-erd-1.6.0/lib/rails_erd/tasks.rake:42:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rails-erd-1.6.0/lib/rails_erd/tasks.rake:42:in `block (2 levels) in <top (required)>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rails-erd-1.6.0/lib/tasks/auto_generate_diagram.rake:18:in `update_model'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rails-erd-1.6.0/lib/tasks/auto_generate_diagram.rake:3:in `block (2 levels) in <top (required)>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/command.rb:48:in `invoke'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:11:in `require'
bin/rails:11:in `<top (required)>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
bin/spring:16:in `require'
bin/spring:16:in `<top (required)>'
bin/rails:5:in `load'
bin/rails:5:in `<main>'
Tasks: TOP => erd => erd:generate => erd:load_models |
Beta Was this translation helpful? Give feedback.
-
Not sure how that's possible but it seems like it's trying to load |
Beta Was this translation helpful? Give feedback.
-
When attempting to use the rails-erd gem to generate database relationship diagrams I get the following error in an application using Solidus:
Has anyone experienced this problem before? There is no occurrence of the attribute
preference
in my code. I am currently going over the Solidus code but there are 79 occurrences of this attribute. Since the error message is not revealing the class name it has become a bit lengthy to debug this issue.Solidus Version:
2.10.1
Desktop:
OSX 10.15.5
Beta Was this translation helpful? Give feedback.
All reactions