[Jifty-commit] r2480 - in jifty/trunk: . lib/Jifty/Param t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Jan 8 23:03:49 EST 2007
Author: alexmv
Date: Mon Jan 8 23:03:48 2007
New Revision: 2480
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Manual/Actions.pod
jifty/trunk/lib/Jifty/Param/Schema.pm
jifty/trunk/t/12-param-schema.t
Log:
r15845 at zoq-fot-pik: chmrr | 2007-01-08 23:03:32 -0500
* 'length is 42' does not work with Object::Declare, due to how it
parses. Normally, 'foo is 42' is parsed as 'is->foo(42)', and the
method call is caught. With built-ins like 'length', however, perl
parses it as 'length(is(42))'.
Jifty::DBI::Schema has a working 'length is 42' because it does not
use Object::Declare. It exports 'length' and 'is', and expects it
to be parsed as 'length(is(42))'.
We instead use 'max_length is 42' instead of 'length is 42'.
Modified: jifty/trunk/lib/Jifty/Manual/Actions.pod
==============================================================================
--- jifty/trunk/lib/Jifty/Manual/Actions.pod (original)
+++ jifty/trunk/lib/Jifty/Manual/Actions.pod Mon Jan 8 23:03:48 2007
@@ -77,12 +77,12 @@
param title =>
label is 'Title',
- length is 50,
+ max_length is 50,
is mandatory;
param category =>
label is 'Category',
- length is 30;
+ max_length is 30;
param body =>
label is 'Entry',
Modified: jifty/trunk/lib/Jifty/Param/Schema.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Param/Schema.pm (original)
+++ jifty/trunk/lib/Jifty/Param/Schema.pm Mon Jan 8 23:03:48 2007
@@ -88,6 +88,7 @@
valid => 'valid_values',
render => 'render_as',
order => 'sort_order',
+ max_length => 'length',
},
copula => {
is => '',
Modified: jifty/trunk/t/12-param-schema.t
==============================================================================
--- jifty/trunk/t/12-param-schema.t (original)
+++ jifty/trunk/t/12-param-schema.t Mon Jan 8 23:03:48 2007
@@ -14,7 +14,7 @@
use Jifty::Action schema {
param keys =>
- length is 30,
+ max_length is 30,
label is 'Search Keys',
hints are 'Enter your search keys here!',
default is 'blah blah blah';
@@ -37,7 +37,7 @@
my $keys = $args->{keys};
ok $keys, 'keys okay';
-is $keys->{length}, 30, 'length ok';
+is $keys->{length}, 30, 'max_length ok';
is $keys->{label}, 'Search Keys', 'label ok';
is $keys->{type}, 'text', 'type ok';
is $keys->{hints}, 'Enter your search keys here!', 'hints okay';
More information about the Jifty-commit
mailing list