Skip to content

Accessing relationships causes an error #1

@smackesey

Description

@smackesey

There is some sort of issue with the monkey-patching of neo4j-core. Given this code:

setup.relation(:records) do
  matches '(n:stmpd)'
  returns 'n'

  def by_type(type)
    where("'#{type}' IN n.type")
  end

end

class Record

  def initialize(res)
    @node = res[:n]
  end

  def d
    @node.props
  end

  def rels
    @node.rels
  end

end

class RecordMapper < ROM::Mapper
  relation :records
  register_as :entity
  model Record
end

rom = ROM.finalize.env

This throws an error:

x = rom.relation(:records).by_type('article').as(:entity).first.rels

The error is:

NoMethodError: undefiend method `result` for {:result => CypherRelationship 2081}:Hash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions