[Jifty-commit] r5082 - in jifty/trunk: lib/Jifty lib/Jifty/Action
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 8 16:47:36 EST 2008
Author: alexmv
Date: Fri Feb 8 16:47:36 2008
New Revision: 5082
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Action/Record.pm
jifty/trunk/lib/Jifty/Record.pm
Log:
r27722 at zoq-fot-pik: chmrr | 2008-02-08 16:47:00 -0500
* Add an ->enumerable method to record classes, so we don't try to
create huge valid_values lists for record classes which are
known-huge.
Modified: jifty/trunk/lib/Jifty/Action/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Action/Record.pm Fri Feb 8 16:47:36 2008
@@ -239,6 +239,8 @@
# Render as a select box unless they override
if ( UNIVERSAL::isa( $refers_to, 'Jifty::Record' ) ) {
$info->{render_as} = $render_as || 'Select';
+
+ $info->{render_as} = 'Text' unless $column->refers_to->enumerable;
}
# If it's a select box, setup the available values
Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Record.pm Fri Feb 8 16:47:36 2008
@@ -895,4 +895,14 @@
sub is_protected { return shift->is_private }
+=head2 enumerable
+
+Controls whether atogenerated actions with columns that refer to this
+class should attempt to provide a drop-down of possible values or not.
+This method will be called as a class method, and defaults to true.
+
+=cut
+
+sub enumerable { 1 }
+
1;
More information about the Jifty-commit
mailing list