[Jifty-commit] r1948 - in jifty/trunk: . lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Sep 10 19:22:04 EDT 2006


Author: jesse
Date: Sun Sep 10 19:22:03 2006
New Revision: 1948

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Action.pm
   jifty/trunk/lib/Jifty/Action/Record.pm

Log:
 r27341 at pinglin:  jesse | 2006-09-11 00:21:58 +0100
 * Debugging improvements to stop stupid developer mistakes like passing the wrong sort of object to a Jifty::Action::Record. 


Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm	(original)
+++ jifty/trunk/lib/Jifty/Action.pm	Sun Sep 10 19:22:03 2006
@@ -191,7 +191,7 @@
 
 sub run {
     my $self = shift;
-    $self->log->debug("Running action");
+    $self->log->debug("Running action ".ref($self) . " " .$self->moniker);
     unless ($self->result->success) {
         $self->log->debug("Not taking action, as it doesn't validate");
 

Modified: jifty/trunk/lib/Jifty/Action/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record.pm	(original)
+++ jifty/trunk/lib/Jifty/Action/Record.pm	Sun Sep 10 19:22:03 2006
@@ -63,9 +63,16 @@
     );
     my $self = $class->SUPER::new(%args);
 
+
     my $record_class = $self->record_class;
     Jifty::Util->require($record_class);
 
+    if (ref $args{'record'} && !$args{'record'}->isa($record_class)) {
+        Carp::confess($args{'record'}." isn't a $record_class");
+    }
+
+
+
     # Set up record
     if ( ref $record_class ) {
         $self->record($record_class);


More information about the Jifty-commit mailing list