Skip to content

Commit

Permalink
Merge pull request #231 from clojure-liberator/andrewmcveigh-multi-me…
Browse files Browse the repository at this point in the history
…thod-decisions

Update of PR #189  multi method decisions
  • Loading branch information
ordnungswidrig committed Oct 1, 2015
2 parents 198f18f + b4ed930 commit f5b99e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/liberator/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5b99e7

Please sign in to comment.