malcolmsparks/compojure-rest — pull request #2 by james-henderson (2012-07-06 14:03:42+00:00)
Title: Decisions referring to multiple states

Resolved the bug whereby multiple states in the HTTP state diagram were being referred to by the same defdecision.

The bug caused states P3 and O14 to be treated the same, and the
consequences of the 'create!'/'update! actions to be the same no
matter where in the state flow-chart they were executed.

Added a 'defdecisionalias' macro s.t. two states can call the same
action on a resource but have different consequences. Examples of use
are:

* Differentiating between a create-conflict? check (P3) and
update-conflict? check (O14)
* Differentiating between a put-update! action (after O14=false) and
post-update! action (after N16=false) - they go to P11 and N11
respectively.
* Differentiating between a post-create! action (after M7/N5) and
put-create! (after P3) - they go to N11/P11 respectively