[Rt-commit] r4214 - in Jifty-DBI/trunk: . lib/Jifty/DBI
jesse at bestpractical.com
jesse at bestpractical.com
Fri Dec 2 01:09:34 EST 2005
Author: jesse
Date: Fri Dec 2 01:09:33 2005
New Revision: 4214
Modified:
Jifty-DBI/trunk/ (props changed)
Jifty-DBI/trunk/META.yml
Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm
Log:
r19678 at truegrounds: jesse | 2005-12-02 00:26:36 -0500
* First cut at named args
Modified: Jifty-DBI/trunk/META.yml
==============================================================================
--- Jifty-DBI/trunk/META.yml (original)
+++ Jifty-DBI/trunk/META.yml Fri Dec 2 01:09:33 2005
@@ -1,5 +1,5 @@
name: Jifty-DBI
-version: 0.05_01
+version: 0.05_02
license: perl
distribution_type: module
build_requires:
@@ -8,7 +8,7 @@
requires:
perl: 5.8.3
DBI: 0
- Encode: 2.11
+ Encode: 2.1
UNIVERSAL::require: 0
Lingua::EN::Inflect: 0
Class::ReturnValue: 0.4
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 Dec 2 01:09:33 2005
@@ -284,6 +284,7 @@
my $column = $self->column($column_name);
my $classname = $column->refers_to();
+ my $remote_column = $column->by() || 'id';
return unless defined $value;
return undef unless $classname;
@@ -292,7 +293,7 @@
# XXX TODO FIXME we need to figure out the right way to call new here
# perhaps the handle should have an initiializer for records/collections
my $object = $classname->new( $self->_handle );
- $object->load_by_cols( id => $value );
+ $object->load_by_cols($remote_column => $value );
return $object;
}
@@ -309,7 +310,7 @@
return unless UNIVERSAL::isa( $classname, 'Jifty::DBI::Collection' );
my $coll = $classname->new( handle => $self->_handle );
- $coll->limit( column => $column->by(), value => $self->id );
+ $coll->limit( column => $column->by(), value => $self->id );
return $coll;
}
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm Fri Dec 2 01:09:33 2005
@@ -41,8 +41,11 @@
$column->refers_to(undef);
$virtual_column->alias_for_column($name);
}
+ #$column->by('id') unless $column->by;
}
- elsif ( UNIVERSAL::isa( $refclass, 'Jifty::DBI::Collection' ) ) {
+ elsif (
+ UNIVERSAL::isa( $refclass, 'Jifty::DBI::Collection' )
+ ) {
$column->by('id') unless $column->by;
}
else {
More information about the Rt-commit
mailing list