From a8b402636a29d3584dc4ff92de5daecd3a768a23 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Aug 2010 11:47:23 -0700 Subject: [PATCH] Shorten ensure_bson --- app/models/user.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 647fe3172..28e750789 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -212,10 +212,6 @@ class User end def ensure_bson id - if id.class == String - BSON::ObjectID(id) - else - id - end + id.class == String ? BSON::ObjectID(id) : id end end