[Catalyst-commits] r8313 - in CatalystX-CRUD/CatalystX-CRUD/trunk:
. lib/CatalystX/CRUD/Model
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Thu Aug 28 19:35:29 BST 2008
Author: karpet
Date: 2008-08-28 19:35:29 +0100 (Thu, 28 Aug 2008)
New Revision: 8313
Modified:
CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm
Log:
always uc() sort dir
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2008-08-28 03:54:03 UTC (rev 8312)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/Changes 2008-08-28 18:35:29 UTC (rev 8313)
@@ -149,6 +149,6 @@
accessor for the config value 'view_on_single_result'
* change all reserved param names in Model::Utils to use 'cxc-' prefix instead of '_'. Backwards compat
is preserved where possible.
+ * Model::Utils make_query() will uc() sort direction
-
Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm 2008-08-28 03:54:03 UTC (rev 8312)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/lib/CatalystX/CRUD/Model/Utils.pm 2008-08-28 18:35:29 UTC (rev 8313)
@@ -115,12 +115,12 @@
for my $p (qw( cxc-sort _sort )) {
my $dir = $params->{'cxc-dir'}
|| $params->{'_dir'};
- return join( ' ', $params->{$p}, $dir )
+ return join( ' ', $params->{$p}, uc($dir) )
if defined( $params->{$p} ) && defined($dir);
}
- my %pks = $c->controller->get_primary_key($c);
- return join( ' ', map { $_ . ' DESC' } keys %pks );
+ my $pks = $c->controller->primary_key;
+ return join( ' ', map { $_ . ' DESC' } ref $pks ? @$pks : ($pks) );
}
sub make_sql_query {
@@ -133,7 +133,7 @@
my $p2q = $self->params_to_sql_query($field_names);
my $params = $c->req->params;
my $sp = Sort::SQL->string2array( $self->_which_sort($c) );
- my $s = join( ' ', map { each %$_ } @$sp );
+ my $s = join( ' ', map {%$_} @$sp );
my $offset = $params->{'cxc-offset'} || $params->{'_offset'};
my $page_size = $params->{'cxc-page_size'}
|| $params->{'_page_size'}
More information about the Catalyst-commits
mailing list