Subject: | not_nullable Documentation |
I noticed that not_nullable is not documented. This is a patch to add
not_nullable documentation do Field.pm.
Subject: | diff.Field.pm |
diff -u a/Field.pm b/Field.pm
--- a/Field.pm 2010-10-07 16:16:27.262087001 +0700
+++ b/Field.pm 2010-10-07 16:35:12.322087003 +0700
@@ -970,6 +970,17 @@
range_end => 120,
}
+=item not_nullable
+
+Flag indicating whether this field is allowed to be NULL or undef. For example, an optional field like this:
+
+has_field 'description' => (
+ type => 'TextArea',
+ not_nullable => 1,
+ );
+
+can be left blank on submit and saved to the database as an empty string '' instead of NULL or undef if it is not a database field. Set this flag if you want to be able to store empty string to a database field with a NOT NULL constraint.
+
=back
=head2 apply