Skip to content

Commit d3f289c

Browse files
author
Visnu Pitiyanuvath
committed
find teams by id or slug
1 parent cdd56c7 commit d3f289c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

models/models.coffee

+4-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ Mongo.blessAll nko
226226

227227
Team::toParam = -> @slug
228228
Team.fromParam = (id, options, fn) ->
229-
@first { slug: id }, options, fn
229+
if id.length == 24
230+
@first { '$or': [ { slug: id }, Mongo.queryify(id) ] }, options, fn
231+
else
232+
@first { slug: id }, options, fn
230233

231234
_.extend exports, nko

0 commit comments

Comments
 (0)