[Jifty-commit] r687 - in jifty/trunk: lib/Jifty/Action/Record

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Mar 14 03:10:38 EST 2006


Author: alexmv
Date: Tue Mar 14 03:10:37 2006
New Revision: 687

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

Log:
 r8514 at zoq-fot-pik:  chmrr | 2006-03-14 03:10:22 -0500
  * All columns includes the 'id' column, which is marked 'mandatory',
    but obviously isn't mandatory for the create action.  Hence, we
    skip 'serial' columns.


Modified: jifty/trunk/lib/Jifty/Action/Record/Create.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record/Create.pm	(original)
+++ jifty/trunk/lib/Jifty/Action/Record/Create.pm	Tue Mar 14 03:10:37 2006
@@ -58,14 +58,12 @@
 
     my %values;
     $values{$_} = $self->argument_value($_) for grep { defined $self->argument_value($_) } $self->argument_names;
-    warn "Values are ".YAML::Dump([$self->arguments]);
-    
-    my ($id) = $record->create(%values);
+    my ($id, $msg) = $record->create(%values);
 
     # Handle errors?
     unless ( $record->id ) {
         $self->result->error("An error occurred.  Try again later");
-        $self->log->error("Create of ".ref($record)." failed: ", $id);
+        $self->log->error("Create of ".ref($record)." failed: $msg");
         return;
     }
 
@@ -87,7 +85,7 @@
 
 sub possible_fields {
     my $self = shift;
-    return map {$_->name} $self->record->columns;
+    return map {$_->name} grep {$_->type ne "serial"} $self->record->columns;
 }
 
 =head2 report_success


More information about the Jifty-commit mailing list