[Jifty-commit] r3596 - in jifty/branches/virtual-models: .
lib/Jifty t/TestApp-DatabaseBackedModels/t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Jul 1 23:57:08 EDT 2007
Author: sterling
Date: Sun Jul 1 23:57:07 2007
New Revision: 3596
Modified:
jifty/branches/virtual-models/ (props changed)
jifty/branches/virtual-models/lib/Jifty/Record.pm
jifty/branches/virtual-models/lib/Jifty/Script/Database.pm
jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t
Log:
r7915 at dynpc145: andrew | 2007-07-01 22:46:04 -0500
Reverting part of my previous commit. Some of those changes are not ready yet.
Modified: jifty/branches/virtual-models/lib/Jifty/Record.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Record.pm (original)
+++ jifty/branches/virtual-models/lib/Jifty/Record.pm Sun Jul 1 23:57:07 2007
@@ -73,7 +73,6 @@
unless ( $self->check_create_rights(@_) ) {
$self->log->error( $self->current_user->id . " tried to create a ",
ref $self, " without permission" );
- Test::More::diag(1);
wantarray ? return ( 0, _('Permission denied') ) : return (0);
}
@@ -101,10 +100,8 @@
else {
$self->log->error("The UUID for $column_name was not found in the database.");
if ($class) {
- Test::More::diag(2);
return($self);
} else {
- Test::More::diag(3);
return (0, "UUID for $column_name was not found in the database.");
}
}
@@ -125,10 +122,8 @@
if ( not $val ) {
$self->log->error("There was a validation error for $key");
if ($class) {
- Test::More::diag(4);
return ($self);
} else {
- Test::More::diag(5);
return ( $val, $msg );
}
}
@@ -145,17 +140,13 @@
if ( ref($msg) ) {
# It's a Class::ReturnValue
- Test::More::diag(6);
return $msg;
}
my ( $id, $status ) = $msg;
$self->load_by_cols( id => $id ) if ($id);
if ($class) {
- Test::More::diag(7);
return $self;
} else {
- use Data::Dumper;
- Test::More::diag("8 ".Dumper($msg));
return wantarray ? ( $id, $status ) : $id;
}
}
Modified: jifty/branches/virtual-models/lib/Jifty/Script/Database.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Script/Database.pm (original)
+++ jifty/branches/virtual-models/lib/Jifty/Script/Database.pm Sun Jul 1 23:57:07 2007
@@ -202,7 +202,7 @@
while ( my $table = $current_tables->next ) {
$self->log->debug("Thinking about upgrading table ".$table->name . "(".$table->__uuid .")");
if ( my $new_table = delete $new_tables->{ $table->__uuid } ) {
- $self->log->debug("It has the same uuid as the proposed replacement");
+ $self->log->debug("It has the same uuid as tne proposed replacement");
# we have the same table in the db and the dump
# let's sync its attributes from the dump then sync its columns
@@ -257,23 +257,20 @@
# now we only have tables that were not yet in the database;
}
- $self->_upgrade_create_new_tables( $new_tables => $columns );
+ $self->_upgrade_create_new_tables( $new_tables => $columns );
}
sub _upgrade_create_new_tables {
my $self = shift;
my $new_tables = shift;
my $columns = shift;
- use Data::Dumper;
- Test::More::diag('_upgrade_create_new_table: '.Dumper($self, $new_tables, $columns));
foreach my $table_id ( keys %$new_tables ) {
my $table = $new_tables->{$table_id};
$self->log->debug("Creating a new table: ".$table->{name});
delete $table->{id};
my $class = Jifty::Model::ModelClass->new();
my ( $val, $msg ) = $class->create( %{$table}, __uuid => $table_id );
- Test::More::diag('CREATE: '.Dumper($val, $msg, $class, $table, $table_id));
- die ($msg||'Unknown error during create.') unless ($val) ;
+ die $msg unless ($val) ;
# Now that we have a brand new model, let's find all its columns
my @cols = grep { $_->{model_class} = $table->{__uuid} } values %$columns;
foreach my $col (@cols) {
Modified: jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t
==============================================================================
--- jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t (original)
+++ jifty/branches/virtual-models/t/TestApp-DatabaseBackedModels/t/dump_load.t Sun Jul 1 23:57:07 2007
@@ -45,10 +45,6 @@
}
);
-# Make sure we don't modify the schema, if these are missing, the whacked
-$new_widgets{'Jifty::Model::ModelClass'} = $dumped_bootstrap->{'Jifty::Model::ModelClass'};
-$new_widgets{'Jifty::Model::ModelClassColumn'} = $dumped_bootstrap->{'Jifty::Model::ModelClass'};
-
$DATABASE->_load_data(\%new_widgets);
More information about the Jifty-commit
mailing list