[Jifty-commit] r2076 - Jifty-DBI/trunk/lib/Jifty/DBI

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Oct 27 11:11:48 EDT 2006


Author: audreyt
Date: Fri Oct 27 11:11:47 2006
New Revision: 2076

Modified:
   Jifty-DBI/trunk/lib/Jifty/DBI/Schema.pm

Log:
* Jifty::DBI::Schema - Backport "valid are qw(...)" and "render as '...'"
  support from Jifty::Param::Schema as aliases to "valid_values are" and
  "render_as".

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 Oct 27 11:11:47 2006
@@ -27,7 +27,7 @@
     column content =>
        type is 'text',
        label is 'Content',
-       render_as 'textarea';
+       render as 'textarea';
 
 defines a column called C<content> that is of type C<text>.  It will be
 rendered with the label C<Content> (note the capital) and as a C<textarea> in
@@ -43,7 +43,7 @@
 use Carp qw/croak carp/;
 use Exporter::Lite;
 our @EXPORT
-    = qw(column type default literal validator immutable unreadable length distinct mandatory not_null sort_order valid_values label hints render_as since input_filters output_filters filters virtual is by are on schema);
+    = qw(column type default literal validator immutable unreadable length distinct mandatory not_null sort_order valid_values label hints render_as render since input_filters output_filters filters virtual is as by are on schema);
 
 our $SCHEMA;
 our $SORT_ORDERS = {};
@@ -413,6 +413,16 @@
     _list( valid_values => @_ );
 }
 
+=head2 valid
+
+Alias for C<valid_values>.
+
+=cut
+
+sub valid {
+    _list( valid_values => @_ );
+}
+
 =head2 label
 
 Designates a human-readable label for the column, for use in user
@@ -485,6 +495,16 @@
     _list( render_as => @_ );
 }
 
+=head2 render
+
+Alias for C<render_as>.
+
+=cut
+
+sub render {
+    _list( render_as => @_ );
+}
+
 =head2 by
 
 Helper method to improve readability.
@@ -506,6 +526,17 @@
     ref $thing eq "ARRAY" ? ( @{$thing}, @_ ) : ($thing, @_);
 }
 
+=head2 as
+
+Helper method to improve readability.
+
+=cut
+
+sub as {
+    my $thing = shift;
+    ref $thing eq "ARRAY" ? ( @{$thing}, @_ ) : ($thing, @_);
+}
+
 =head2 are
 
 Helper method to improve readability.


More information about the Jifty-commit mailing list