Created
March 28, 2012 22:13
-
-
Save wapcaplet/2231007 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Return default values for important properties | |
def self.defaults | |
{ | |
:status => 'active', | |
:root => URINode.new(:name => '__root__'), | |
:taxonomy => TaxonomyNode.new(:name => '__taxonomy__'), | |
} | |
end | |
def init_on_create(*args) | |
# Merge keyword arguments with defaults | |
if args[0].respond_to?(:each_pair) | |
super(self.class.defaults.merge(args[0]), *args[1..-1]) | |
else | |
super(*args) | |
end | |
Neo4j.ref_node.outgoing(:websites) << self | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment