From 99fb383dc06ed78f39a77eb16ecc875ff1573acf Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Aug 2010 11:13:00 -0700 Subject: [PATCH] BSONify ids in by_id methods --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 1a3504120..f22290e18 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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