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