I have an application which uses Neo4j to back-end one model and PostgreSQL to back-end all the other models. Here is the Neo4j model:
class Concept
include Neo4j::ActiveNode
property :name
def references
Reference.where(concept_uuid: uuid)
end
end
and here is an ActiveRecord model. The references table has a content_uuid on it:
class Reference < ActiveRecord::Base
def concept
Concept.where(uuid: concept_uuid).first
end
end
This works, and I can do things like Reference.first.concept
and Concept.first.references
without incident. I wish, though, that I could do something simple like this instead:
class Reference < ActiveRecord::Base
belongs_to :concepts
end
class Concept < ActiveRecord::Base
include Neo4j::ActiveNode
property :name
has_many :references
end
because then I'd get things like Concept.first.references << new_reference
out of the box. Does any such functionality exist?