neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 277 forks source link

Duplicate nodes with deep with_associations on QueryProxy #1576

Open amitsuryavanshi opened 4 years ago

amitsuryavanshi commented 4 years ago

Additional information which could be helpful if relevant to your issue:

Code example (inline, gist, or repo)

Following spec in spec/e2e/association_proxy_spec.rb fails,

it 'does not fetches duplicate nodes with deep with_associations' do
      Student.create(name: 'Leszek').lessons << science
      Student.create(name: 'Lukasz').lessons << science
      log_queries!

      Student.all.with_associations({lessons: :exams_given}).each do |student|
          student.lessons.each do |lesson|
            expect(lesson.exams_given).to contain_exactly(science_exam, science_exam2) if lesson == science
          end
      end
    end

Runtime information:

Neo4j database version: neo4j gem version: 9.6.0 neo4j-core gem version: NA