From eb9dfdb505d71bec73edf9852fc2022ac924cc88 Mon Sep 17 00:00:00 2001 From: Philipp Meier Date: Thu, 1 Oct 2015 10:30:23 +0200 Subject: [PATCH 1/2] Remove unnecessary test in decide function * If `defdecision` would specify a test function which is not a function or multi-fn it would be ignored. --- src/liberator/core.clj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/liberator/core.clj b/src/liberator/core.clj index 8a847cb..05237f5 100644 --- a/src/liberator/core.clj +++ b/src/liberator/core.clj @@ -71,9 +71,8 @@ (declare handle-exception) (defn decide [name test then else {:keys [resource request] :as context}] - (if (or (fn? test) - (instance? clojure.lang.MultiFn test) - (contains? resource name)) + (if (or test + (contains? resource name)) (try (let [ftest (or (resource name) test) ftest (make-function ftest) From b4ed9306c1ea120a5562cd80f29b617e90e940d4 Mon Sep 17 00:00:00 2001 From: Philipp Meier Date: Thu, 1 Oct 2015 11:19:30 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGES.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.markdown b/CHANGES.markdown index 5ebb1d6..678c78f 100644 --- a/CHANGES.markdown +++ b/CHANGES.markdown @@ -5,6 +5,10 @@ * Values can be added to the context at the beginning of the execution flow using the :initialize-context action. +## Bugs fixed + +* Support multimethods as decision functions. + # New in 0.13 * Optionally a value can be specified for ring-response