【发布时间】:2017-03-23 19:32:13
【问题描述】:
我正在升级到 Neo4j.rb 版本 8。按照 upgrade guide 中的说明进行操作后,之前通过的规范现在失败了。
具体来说,count、persisted?、all、last 和 find 似乎已经相互脱节。我可以创建一个帐户,看看它是持久的,如果我计算帐户时看到它,但如果我查找最后一个帐户或所有帐户,或者尝试从其 id 中找到它,则不会。
以下控制台会话的输出。我疯了吗?
[1] pry> account = Account.create(company_name: "Acme Corporation, LLC", street_address: "1234 Fake Lane", city: "Pleasantville", state: "CA", zip: "12345", country: "United States", phone: "555-555-5555", contact_name: "Some Guy", contact_phone: "123-456-7890", contact_email: "someguy@acmecorp.com")
=> #<Account uuid: "30c44118-ac45-4559-b63b-8e82fafb16cd", city: "Pleasantville", company_name: "Acme Corporation, LLC", contact_email: "someguy@acmecorp.com", contact_name: "Some Guy", contact_phone: "123-456-7890", country: "United States", created_at: Thu, 23 Mar 2017 19:13:52 +0000, phone: "555-555-5555", remote_id: nil, state: "CA", street_address: "1234 Fake Lane", updated_at: Thu, 23 Mar 2017 19:13:52 +0000, zip: "12345">
[2] pry> account.persisted?
=> true
[3] pry> Account.count
=> 1
[4] pry> Account.last
=> nil
[5] pry> Account.find(account.id)
Neo4j::ActiveNode::Labels::RecordNotFound: Couldn't find Account with 'uuid'=30c44118-ac45-4559-b63b-8e82fafb16cd
【问题讨论】:
标签: ruby-on-rails neo4j rspec-rails neo4j.rb