Рельсы 6 и neo4j.rb? - PullRequest
       36

Рельсы 6 и neo4j.rb?

0 голосов
/ 28 апреля 2019

Есть ли разработка для Rails 6 в Neo4j.rb?В новом проекте rails 6 (rc1), если я создаю пару скаффолдов, то запускаю 'rake neo4j: migrate: all', я получаю ошибку, что при быстром следовании ямы гораздо глубже проникают во внутренние части ActiveModel, чем я могу разобрать:

NoMethodError: undefined method `force_change' for #<ActiveModel::NullMutationTracker:0x00007fa1aadd8788>
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/activemodel-6.0.0.rc1/lib/active_model/dirty.rb:268:in `attribute_will_change!'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/activemodel-6.0.0.rc1/lib/active_model/attribute_methods.rb:383:in `migration_id_will_change!'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/property.rb:213:in `block in attribute!'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/property.rb:51:in `block in send_props'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/property.rb:51:in `each'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/property.rb:51:in `send_props'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/property.rb:32:in `initialize'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/active_node/property.rb:7:in `initialize'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/callbacks.rb:19:in `block in initialize'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/callbacks.rb:101:in `run_callbacks'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/shared/callbacks.rb:19:in `initialize'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/active_node.rb:53:in `initialize'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/active_node/persistence.rb:116:in `new'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/active_node/persistence.rb:116:in `create!'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/base.rb:31:in `migrate_up'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/base.rb:16:in `block in migrate'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/base.rb:15:in `migrate'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:127:in `block in migrate'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:133:in `migration_message'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:125:in `migrate'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:26:in `block in all'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:24:in `each'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/migrations/runner.rb:24:in `all'
/Users/metkat/.rvm/gems/ruby-2.6.0/gems/neo4j-9.2.4/lib/neo4j/tasks/migration.rake:116:in `block (3 levels) in <main>'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/Users/metkat/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/Users/metkat/.rvm/gems/ruby-2.6.0/bin/rake:23:in `load'
/Users/metkat/.rvm/gems/ruby-2.6.0/bin/rake:23:in `<main>'
/Users/metkat/.rvm/gems/ruby-2.6.0/bin/ruby_executable_hooks:24:in `eval'
/Users/metkat/.rvm/gems/ruby-2.6.0/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => neo4j:migrate:all

1 Ответ

1 голос
/ 28 мая 2019

Похоже, это связано с этим PR , который приземлился в RC1, я столкнулся с той же проблемой. Я пинговал эту ветку, чтобы узнать, была ли она намеренной. А пока попробуйте откатиться до последней бета-версии или патча обезьяны ActiveModel::NullMutationTracker (что я и сделал, и подтвердил, что это исправило проблему), добавив в него следующие методы:

  def forget_change(attr_name)
  end

  def original_value(attr_name)
  end

  def force_change(attr_name)
  end
...