BSONify ids in by_id methods

This commit is contained in:
Raphael 2010-08-16 11:13:00 -07:00
parent eb793ea129
commit 99fb383dc0

View file

@ -190,11 +190,11 @@ class User
end
def friend_by_id( id )
friends.detect{|x| x.id == id }
friends.detect{|x| x.id == id || x.id == BSON::ObjectID(id) }
end
def group_by_id( id )
groups.detect{|x| x.id == id }
groups.detect{|x| x.id == id || x.id == BSON::ObjectID(id) }
end
protected