|
From: Chris W. <la...@us...> - 2001-11-26 16:27:23
|
Update of /cvsroot/openinteract/SPOPS
In directory usw-pr-cvs1:/tmp/cvs-serv32210
Modified Files:
Changes SPOPS.pm TODO
Log Message:
fixed behavior in clone() method -- multifield checks are now
generated by the multifield class factory behavior, and the previous
clone() behavior has been restored. (Thanks to Ray Z for catching.)
Index: Changes
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/Changes,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** Changes 2001/11/25 01:34:42 1.72
--- Changes 2001/11/26 16:27:19 1.73
***************
*** 1,4 ****
--- 1,28 ----
Revision history for Perl extension SPOPS.
+ 0.54
+
+ Overall:
+
+ - Fix bug introduced by 0.53 in the clone() method
+
+ Individual:
+
+ * SPOPS.pm:
+
+ - Modify clone() method to behave as previous -- the
+ multifield-specific behavior is now in a separate method
+
+ * SPOPS/ClassFactory/DBI.pm:
+
+ - Generate clone() method for classes using multifield primary
+ keys
+
+ * t/31_dbi_multifield.t:
+
+ - Modify clone save() test (#12) to specify one value of the ID in
+ the clone() call and set the other one afterward.
+
+
0.53 Sat Nov 24 20:50:32 EST 2001
Index: SPOPS.pm
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/SPOPS.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** SPOPS.pm 2001/11/25 01:23:37 1.56
--- SPOPS.pm 2001/11/26 16:27:19 1.57
***************
*** 173,191 ****
my $class = $p->{_class} || ref $self;
DEBUG() && _w( 1, "Cloning new object of class ($class) from old ",
! "object of class (", ref $self, ")" );
my %initial_data = ();
while ( my ( $k, $v ) = each %{ $self } ) {
$initial_data{ $k } = $p->{ $k } || $v;
}
! my $cloned = $class->new({ %initial_data, skip_default_values => 1 });
!
! # Take care of the ID value AFTER the object has been instantiated
! # so we can rely on its id() method to take care of any funky
! # assignment needs
!
! $cloned->id( $p->{id} ) if ( $p->{id} );
! return $cloned;
}
--- 173,191 ----
my $class = $p->{_class} || ref $self;
DEBUG() && _w( 1, "Cloning new object of class ($class) from old ",
! "object of class (", ref $self, ")" );
my %initial_data = ();
+ my $id_field = $class->id_field;
+ if ( $id_field ) {
+ $initial_data{ $id_field } = $p->{ $id_field } || $p->{id};
+ }
+
while ( my ( $k, $v ) = each %{ $self } ) {
+ next unless ( $k );
+ next if ( $k eq $id_field );
$initial_data{ $k } = $p->{ $k } || $v;
}
! return $class->new({ %initial_data, skip_default_values => 1 });
}
Index: TODO
===================================================================
RCS file: /cvsroot/openinteract/SPOPS/TODO,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TODO 2001/10/09 01:54:37 1.6
--- TODO 2001/11/26 16:27:19 1.7
***************
*** 2,18 ****
========================================
! 0.5x
!
! - (API) Figure out what configuration object/hashref is supposed to
! be passed to the 'class_initialize' method.
!
! - User/Group API (doc) (SF ID: 468906)
- creation security - variable group ID (SF ID: 468907)
- - Run a process to transform L<Blah::Blah> to
- L<Blah::Blah|Blah::Blah>.
-
- Export generated SPOPS class to file (SF ID: 468902)
0.55
--- 2,12 ----
========================================
! 0.54
- creation security - variable group ID (SF ID: 468907)
- Export generated SPOPS class to file (SF ID: 468902)
+
+ - Create SPOPS::DBI::MultiDatasource
0.55
|