Skip to content

Instantly share code, notes, and snippets.

@adkron
Created November 3, 2010 20:34
Show Gist options
  • Select an option

  • Save adkron/661664 to your computer and use it in GitHub Desktop.

Select an option

Save adkron/661664 to your computer and use it in GitHub Desktop.
class Connection
include Mongoid::Document
references_one :originating_user, :inverse_of => :my_connections, :class_name => "User"
references_one :destination_user, :inverse_of => :other_connections, :class_name => "User"
end
class User
include Mongoid::Document
referenced_in :my_connections, :inverse_of => :originating_user, :class_name => "Connection"
referenced_in :other_connections, :inverse_of => :destination_user, :class_name => "Connection"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment