From: Dave Rolsky Date: Wed, 5 Jun 2013 16:33:35 +0000 (-0500) Subject: Clarify how to check whether old value is passed to a trigger X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f1b9555cfda7afaaf652f1a9eef2d8fa89257a9;p=gitmo%2Fmoose-presentations.git Clarify how to check whether old value is passed to a trigger --- diff --git a/moose-class/exercises/t/06-advanced-attributes.t b/moose-class/exercises/t/06-advanced-attributes.t index e2b13e3..1583334 100644 --- a/moose-class/exercises/t/06-advanced-attributes.t +++ b/moose-class/exercises/t/06-advanced-attributes.t @@ -17,7 +17,8 @@ # Use a trigger to record the _old value_ of the balance each time it # changes. This means your trigger should not do anything if it is not passed # an old value (this will be the case when the attribute is set for the first -# time). +# time). You can check for the presence of an old value by looking at the +# number of elements passed to the trigger in the @_ array. # # Now you can delete the HasAccount role entirely. Instead, add an "account" # attribute to Person directly.