Skip to content

Instantly share code, notes, and snippets.

@tanordheim
Created April 24, 2010 00:00
Show Gist options
  • Save tanordheim/377324 to your computer and use it in GitHub Desktop.
Save tanordheim/377324 to your computer and use it in GitHub Desktop.
class BarNode < Node
field :bar_test
end
class FooNode < Node
field :foo_test
end
class Node
include Mongoid::Document
field :title
belongs_to_related :parent, :class_name => "Node", :foreign_key => :node_id
has_many_related :children, :class_name => "Node"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment