I was afraid that. :(<br><br><div><span class="gmail_quote">On 8/16/07, <b class="gmail_sendername"><a href="mailto:jifty-commit@lists.jifty.org">jifty-commit@lists.jifty.org</a></b> <<a href="mailto:jifty-commit@lists.jifty.org">
jifty-commit@lists.jifty.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Author: trs<br>Date: Thu Aug 16 15:59:16 2007
<br>New Revision: 3911<br><br>Modified:<br> Jifty-DBI/trunk/ (props changed)<br> Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm<br> Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm<br> Jifty-DBI/trunk/t/11schema_records.t<br><br>
Log:<br> r26169@zot: tom | 2007-08-16 15:58:56 -0400<br> Backup r3908 for now since it breaks existing code<br><br><br>Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm<br>==============================================================================
<br>--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm (original)<br>+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm Thu Aug 16 15:59:16 2007<br>@@ -259,20 +259,11 @@<br> if ( $column->readable ) {<br> if ( UNIVERSAL::isa( $column->refers_to, "Jifty::DBI::Record" ) )
<br> {<br>- if ($column->virtual) {<br>- $subref = sub {<br>- if ( @_ > 1 ) { Carp::carp "Value passed to column accessor. You probably want to use the mutator." }
<br>- $_[0]->_to_record( $column_name,<br>- $_[0]->id );<br>- };<br>- }<br>- else {<br>- $subref = sub {
<br>- if ( @_ > 1 ) { Carp::carp "Value passed to column accessor. You probably want to use the mutator." }<br>- $_[0]->_to_record( $column_name,<br>- $_[0]->__value($column_name) );
<br>- };<br>- }<br>+ $subref = sub {<br>+ if ( @_ > 1 ) { Carp::carp "Value passed to column accessor. You probably want to use the mutator." }
<br>+ $_[0]->_to_record( $column_name,<br>+ $_[0]->__value($column_name) );<br>+ };<br> } elsif (<br> UNIVERSAL::isa(
<br> $column->refers_to, "Jifty::DBI::Collection"<br><br>Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm<br>==============================================================================
<br>--- Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm (original)<br>+++ Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm Thu Aug 16 15:59:16 2007<br>@@ -346,9 +346,6 @@<br> # A one-to-one or one-to-many relationship is requested
<br> if ( UNIVERSAL::isa( $refclass, 'Jifty::DBI::Record' ) ) {<br><br>- # Make this a virtual record reference if they set by<br>- $column->virtual(1) if defined $column->by and $column->by ne 'id';
<br>-<br> # Handle *_id reference columns specially<br> if ( $name =~ /(.*)_id$/ ) {<br> my $aliased_as = $1;<br><br>Modified: Jifty-DBI/trunk/t/11schema_records.t<br>==============================================================================
<br>--- Jifty-DBI/trunk/t/11schema_records.t (original)<br>+++ Jifty-DBI/trunk/t/11schema_records.t Thu Aug 16 15:59:16 2007<br>@@ -9,7 +9,7 @@<br> BEGIN { require "t/utils.pl" }<br> our (@available_drivers);
<br><br>-use constant TESTS_PER_DRIVER => 74;<br>+use constant TESTS_PER_DRIVER => 67;<br><br> my $total = scalar(@available_drivers) * TESTS_PER_DRIVER;<br> plan tests => $total;<br>@@ -193,20 +193,8 @@<br> is($ph->phone, '7890');
<br> is($phone_collection->next, undef);<br> }<br>-<br>- is($emp->favorite_color->id, undef, 'emp 1 has no favorite color yet');<br>- is($emp2->favorite_color->id, undef, 'emp 2 has no favorite color yet');
<br><br>- my $color = TestApp::Color->new( handle => $handle );<br>- my $c_id = $color->create( employee => $emp, color => 'magenta' );<br>- ok($c_id, "Got an id for the new color: $c_id");
<br>- $color->load($c_id);<br>- is($color->id, $c_id);<br>- is($emp->favorite_color->id, $c_id, 'emp fave id matches color id');<br>- $emp->favorite_color->set_color('cyan');
<br>- is($emp->favorite_color->color, 'cyan', 'changed color to cyan');<br>- $color->load($c_id);<br>- is($color->color, 'cyan', 'changed the original too');
<br>+<br><br> cleanup_schema( 'TestApp', $handle );<br> disconnect_handle( $handle );<br>@@ -228,14 +216,8 @@<br> id integer primary key,<br> employee integer NOT NULL,<br> phone varchar(18)
<br>-)<br>-}, q{<br>-CREATE table colors (<br>- id integer primary key,<br>- employee integer NOT NULL,<br>- color varchar(8)<br>-)<br>-} ]<br>+) }<br>+]<br> }<br><br> sub schema_mysql {<br>@@ -250,12 +232,6 @@
<br> employee integer NOT NULL,<br> phone varchar(18)<br> )<br>-}, q{<br>-CREATE TEMPORARY table colors (<br>- id integer AUTO_INCREMENT primary key,<br>- employee integer NOT NULL,<br>- color varchar(8)
<br>-)<br> } ]<br> }<br><br>@@ -271,13 +247,7 @@<br> employee integer references employees(id),<br> phone varchar<br> )<br>-}, q{<br>-CREATE TEMPORARY table colors (<br>- id serial PRIMARY KEY,<br>- employee integer references employees(id),
<br>- color varchar<br>-)<br>-}]<br>+} ]<br> }<br><br> package TestApp::PhoneCollection;<br>@@ -289,9 +259,6 @@<br> return $tab;<br> }<br><br>-package TestApp::Color;<br>-use base qw/Jifty::DBI::Record/;<br>-<br>
package TestApp::Employee;<br> use base qw/Jifty::DBI::Record/;<br><br>@@ -300,7 +267,6 @@<br> use Jifty::DBI::Record schema {<br> column name => type is 'varchar';<br> column phones => references TestApp::PhoneCollection by 'employee';
<br>- column favorite_color => references TestApp::Color by 'employee';<br> }<br> }<br><br>@@ -321,19 +287,5 @@<br> }<br> }<br><br>-package TestApp::Color;<br>-<br>-BEGIN {<br>- use Jifty::DBI::Schema;
<br>- use Jifty::DBI::Record schema{<br>- column employee => references TestApp::Employee;<br>- column color =><br>- type is 'varchar',<br>- valid_values are qw/<br>- white cyan magenta
<br>- yellow green red black<br>- /; # don't like CGA? too bad<br>- }<br>-}<br><br> 1;<br>_______________________________________________<br>Jifty-commit mailing list<br><a href="mailto:Jifty-commit@lists.jifty.org">
Jifty-commit@lists.jifty.org</a><br><a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit</a><br></blockquote></div><br>