I have 3 nodes, B, C and D. I require similar associations between C and B, and D and B
To be DRY, rather than putting the 'has_many' individually on C and D, i created a super class A and added the association there, like so:
class A
include Neo4j::ActiveNode
has_many :out, :related_b_nodes, model_class: :B, type: :some_type
end
class B
include Neo4j::ActiveNode
has_many :in, :related_a_nodes, model_class: :A, origin: :related_b_nodes
end
When I inherit from A:
class C < A
end
class D < A
end
The code works alright when I test it through the rails console, but rspec continues to fail, displaying the message:
Association `related_b_nodes` defined for a second time.
Associations can only be defined once (Class#related_b_nodes) (RuntimeError)
What might be the problem?