[Catalyst-commits] r8830 - in
CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk: .
lib/CatalystX/CRUD/Model lib/CatalystX/CRUD/Object
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Thu Dec 11 21:48:34 GMT 2008
Author: karpet
Date: 2008-12-11 21:48:34 +0000 (Thu, 11 Dec 2008)
New Revision: 8830
Modified:
CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Model/RDBO.pm
CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Object/RDBO.pm
Log:
release 0.18
Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes 2008-12-11 16:42:39 UTC (rev 8829)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/Changes 2008-12-11 21:48:34 UTC (rev 8830)
@@ -62,3 +62,7 @@
0.17 25 Nov 2008
* added related_load_with() feature and docs for it and load_with().
+0.18 11 Dec 2008
+ * fix logic for mangling sort_by with table prefix. If the sort_by value already has a . (dot)
+ in it, assume the request knew what it was doing.
+
Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Model/RDBO.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Model/RDBO.pm 2008-12-11 16:42:39 UTC (rev 8829)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Model/RDBO.pm 2008-12-11 21:48:34 UTC (rev 8830)
@@ -7,7 +7,7 @@
use Carp;
use Data::Dump qw( dump );
-our $VERSION = '0.17';
+our $VERSION = '0.18';
__PACKAGE__->mk_ro_accessors(
qw( name manager treat_like_int load_with related_load_with ));
@@ -317,6 +317,7 @@
multi_many_ok => 1
);
}
+
#warn dump \@arg;
return @arg;
}
@@ -487,14 +488,18 @@
# many2many relationships always have two tables,
# and we are sorting my the 2nd one. The 1st one is the mapper.
- if ( $c->req->params->{'cxc-m2m'} ) {
- if ( length( $q->{sort_by} ) and !( $q->{sort_by} =~ m/t\d\./ ) ) {
- $q->{sort_by} = $self->_join_with_table_prefix( $q, 't2' );
+ # however, we leave sort_by alone if it already has . in it,
+ # since then we assume the request knew enough to ask.
+ if ( length( $q->{sort_by} ) && !( $q->{sort_by} =~ m/\./ ) ) {
+ if ( $c->req->params->{'cxc-m2m'} ) {
+ if ( !( $q->{sort_by} =~ m/t\d\./ ) ) {
+ $q->{sort_by} = $self->_join_with_table_prefix( $q, 't2' );
+ }
}
- }
- else {
- if ( length( $q->{sort_by} ) and !( $q->{sort_by} =~ m/t\d\./ ) ) {
- $q->{sort_by} = $self->_join_with_table_prefix( $q, 't1' );
+ else {
+ if ( !( $q->{sort_by} =~ m/t\d\./ ) ) {
+ $q->{sort_by} = $self->_join_with_table_prefix( $q, 't1' );
+ }
}
}
Modified: CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Object/RDBO.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Object/RDBO.pm 2008-12-11 16:42:39 UTC (rev 8829)
+++ CatalystX-CRUD/CatalystX-CRUD-Model-RDBO/trunk/lib/CatalystX/CRUD/Object/RDBO.pm 2008-12-11 21:48:34 UTC (rev 8830)
@@ -3,7 +3,7 @@
use warnings;
use base qw( CatalystX::CRUD::Object );
-our $VERSION = '0.17';
+our $VERSION = '0.18';
=head1 NAME
More information about the Catalyst-commits
mailing list