[jifty-devel] Fwd: [Jifty-commit] r1009 -
Jifty-DBI/trunk/lib/Jifty/DBI
Eric Wilhelm
scratchcomputing at gmail.com
Fri May 5 16:45:47 EDT 2006
In case anyone saw this in the commits and is wondering what's going on,
I had a bit of an accident.
996-1007 were my misuse of svk. 1009 is the undo for that
I did really mean 1008.
--Eric
---------- Forwarded Message: ----------
Subject: [Jifty-commit] r1009 - Jifty-DBI/trunk/lib/Jifty/DBI
Date: Friday 05 May 2006 01:30 pm
From: jifty-commit at lists.jifty.org
To: jifty-commit at lists.jifty.org
Author: ewilhelm
Date: Fri May 5 16:30:24 2006
New Revision: 1009
Modified:
Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
Jifty-DBI/trunk/lib/Jifty/DBI/SchemaGenerator.pm
Log:
lib/Jifty/DBI/SchemaGenerator.pm - undo
lib/Jifty/DBI/Record.pm - undo
** sorry, svk hiccup **
** ignore 996 thru 1007 **
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
=======================================================================
======= --- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm Fri May 5 16:30:24 2006
@@ -88,113 +88,6 @@
}
-sub AUTOLOAD {
- my $self = $_[0];
-
- $self->_init_columns() unless $self->COLUMNS;
-
- my ( $column_name, $action ) =
$self->_parse_autoload_method($AUTOLOAD); -
- unless ( $action and $column_name ) {
- my ( $package, $filename, $line ) = caller;
- die "$AUTOLOAD Unimplemented in $package. ($filename line
$line) \n"; - }
-
- my $column = $self->column($column_name);
-
- unless ($column) {
- my ( $package, $filename, $line ) = caller;
- die "$AUTOLOAD Unimplemented in $package. ($filename line
$line) \n"; - }
-
- no strict 'refs'; # We're going to be defining subs
- if ( $action eq 'read' ) {
- return '' unless $column->readable;
-
- if ( UNIVERSAL::isa( $column->refers_to, "Jifty::DBI::Record"
) ) { - *{$AUTOLOAD} = sub {
- $_[0]->_to_record( $column_name,
- $_[0]->__value($column_name) );
- };
- } elsif (
- UNIVERSAL::isa( $column->refers_to,
"Jifty::DBI::Collection" ) ) - {
- *{$AUTOLOAD} = sub {
$_[0]->_collection_value($column_name) }; - } else {
- *{$AUTOLOAD} = sub { return ( $_[0]->_value($column_name)
) }; - }
- goto &$AUTOLOAD;
- } elsif ( $action eq 'write' ) {
- return ( 0, 'Immutable column' ) unless $column->writable;
-
- if ( UNIVERSAL::isa( $column->refers_to, "Jifty::DBI::Record"
) ) { - *{$AUTOLOAD} = sub {
- my $self = shift;
- my $val = shift;
-
- $val = $val->id
- if UNIVERSAL::isa( $val, 'Jifty::DBI::Record' );
- return (
- $self->_set( column => $column_name, value => $val
) ); - };
- } elsif (
- UNIVERSAL::isa( $column->refers_to,
"Jifty::DBI::Collection" ) ) - { # XXX elw: collections land
here
- *{$AUTOLOAD} = sub {
- # use YAML; die 'column: ', YAML::Dump($column), " ";
- die "cannot write to referenced column";
- };
- } else {
- *{$AUTOLOAD} = sub {
- return (
- $_[0]->_set( column => $column_name, value =>
$_[1] ) ); - };
- }
- goto &$AUTOLOAD;
- } elsif ( $action eq 'validate' ) {
- *{$AUTOLOAD}
- = sub { return ( $_[0]->_validate( $column_name, $_[1] ) )
}; - goto &$AUTOLOAD;
- }
-
- else {
- my ( $package, $filename, $line ) = caller;
- die "$AUTOLOAD Unimplemented in $package. ($filename line
$line) \n"; - }
-
-}
-
-=head2 _parse_autoload_method $AUTOLOAD
-
-Parses autoload methods and attempts to determine if they're
-set, get or validate calls.
-
-Returns a tuple of (COLUMN_NAME, ACTION);
-
-=cut
-
-sub _parse_autoload_method {
- my $self = shift;
- my $method = shift;
-
- my ( $column_name, $action );
-
- if ( $method =~ /^.*::set_(\w+)$/o ) {
- $column_name = $1;
- $action = 'write';
- } elsif ( $method =~ /^.*::validate_(\w+)$/o ) {
- $column_name = $1;
- $action = 'validate';
-
- } elsif ( $method =~ /^.*::(\w+)$/o ) {
- $column_name = $1;
- $action = 'read';
-
- }
- return ( $column_name, $action );
-
-}
-
=head2 _accessible COLUMN ATTRIBUTE
Private method.
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/SchemaGenerator.pm
=======================================================================
======= --- Jifty-DBI/trunk/lib/Jifty/DBI/SchemaGenerator.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/SchemaGenerator.pm Fri May 5
16:30:24 2006 @@ -208,7 +208,6 @@
Returns a string containing a sequence of SQL statements to create
tables for all of the models added to the SchemaGenerator.
-=end
=cut
_______________________________________________
Jifty-commit mailing list
Jifty-commit at lists.jifty.org
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
-------------------------------------------------------
--
"These crispix get soggy so quickly."
-- Tina Connolly
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------
More information about the jifty-devel
mailing list