You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like calling each_rel or rels affects the relation and removes objects from it.
Previously we were using:
Neo4j database version: 4.4
ActiveGraph version: 11.1.0.alpha.4
Neo4j-driver-ruby: 4.4.3
Code below was working as expected.
Now we try to upgrade gem versions to:
Neo4j database version: 4.4
ActiveGraph version: 11.3.1
Neo4j-driver-ruby: 4.4.4
Code example (inline, gist, or repo)
classSkill# ...has_many:out,:categories,model_class: :SkillCategory,rel_class: :SkillInCategory# ...endclassSkillCategory < Categoryhas_many:in,:contents,model_class: :Skill,rel_class: :SkillInCategoryend# Later we have test to check if we create uniq relations:skill.categories << skill_categoryskill.categories << skill_categoryskill.categories << skill_categoryskill.categories.each_rel.count == 1skill.categories == [skill_category]# Fails, skill.categories relation is empty.
# Problem is with the order of the operations. Looks like calling `each_rel` replaces skill_categories with empty array.
# Real output from console:
[13] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories
=> #<AssociationProxy Skill#categories [#<SkillCategory _global_id: "test-skill-category_1000001", _source_id: "1000001", _source_type: "test-skill-category", description: nil, name: "Organized systemic analyzer">]>
[14] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories.each_rel.size
=> 1
[15] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories
=> #<AssociationProxy Skill#categories []>
[16] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.reload
=> #<Skill _global_id: "test-skill_1000001", _source_id: "1000001", _source_type: "test-skill", name: "Integrated Contextually-Based Ability">
[17] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories
=> #<AssociationProxy Skill#categories [#<SkillCategory _global_id: "test-skill-category_1000001", _source_id: "1000001", _source_type: "test-skill-category", description: nil, name: "Organized systemic analyzer">]>
[18] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories.rels.size
=> 1
[19] pry(#<RSpec::ExampleGroups::Skill::UniqueCategories>)> skill.categories
=> #<AssociationProxy Skill#categories []>
The text was updated successfully, but these errors were encountered:
Looks like calling
each_rel
orrels
affects the relation and removes objects from it.Previously we were using:
Neo4j database version: 4.4
ActiveGraph version: 11.1.0.alpha.4
Neo4j-driver-ruby: 4.4.3
Code below was working as expected.
Now we try to upgrade gem versions to:
Neo4j database version: 4.4
ActiveGraph version: 11.3.1
Neo4j-driver-ruby: 4.4.4
Code example (inline, gist, or repo)
The text was updated successfully, but these errors were encountered: