don't allow nil in :offset or :limit

This commit is contained in:
Justin Kramer 2012-08-24 17:35:49 -04:00
parent cfadae53d1
commit faa495c362

View file

@ -123,10 +123,14 @@
(update-in m [:order-by] concat (collify fields)))
(defhelper limit [m l]
(assoc m :limit (if (coll? l) (first l) l)))
(if (nil? l)
m
(assoc m :limit (if (coll? l) (first l) l))))
(defhelper offset [m o]
(assoc m :offset (if (coll? o) (first o) o)))
(if (nil? o)
m
(assoc m :offset (if (coll? o) (first o) o))))
(defhelper modifiers [m ms]
(assoc m :modifiers (collify ms)))