Skip to content

Instantly share code, notes, and snippets.

@actsasbuffoon
Created June 4, 2010 00:06
Show Gist options
  • Save actsasbuffoon/424704 to your computer and use it in GitHub Desktop.
Save actsasbuffoon/424704 to your computer and use it in GitHub Desktop.
ruby-1.8.7-p249 > u1 = User.first(:username => "mtomer")
=> #<User username: "mtomer", _id: $oid4b4df1f6af64e72ac6000001, master_user_id: nil>
ruby-1.8.7-p249 > u2 = User.first(:username => "mtomer2")
=> #<User username: "mtomer2", _id: $oid4b869089af64e75e58000003, master_user_id: $oid4b4df1f6af64e72ac6000001>
ruby-1.8.7-p249 > u1._id.class
=> BSON::ObjectID
ruby-1.8.7-p249 > u2.master_user_id.class
=> BSON::ObjectID
ruby-1.8.7-p249 > u1._id == u2.master_user_id
=> true
ruby-1.8.7-p249 > User.all(:master_user_id => u1._id)
=> []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment