Created
July 29, 2015 08:12
-
-
Save dapicester/e0dde9f9983b40497660 to your computer and use it in GitHub Desktop.
ActiveRecord and ActiveNode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Concept | |
include Neo4j::ActiveNode | |
property :name | |
def references | |
Reference.where(concept_uuid: uuid) | |
end | |
end | |
# example: Concept.first.references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Reference < ActiveRecord::Base | |
def concept | |
Concept.where(uuid: concept_uuid).first | |
end | |
end | |
# example: Reference.first.concept |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment