BSONify ids in by_id methods
This commit is contained in:
parent
eb793ea129
commit
99fb383dc0
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue