Permalink
Browse files

If a field is defined as required or unique then we no longer allow e…

…mpty string '' as a valid value.
  • Loading branch information...
rizen committed May 24, 2016
1 parent 14ef003 commit 75bc67f82344e6efd361be8201bc27adbe45271b
Showing with 6 additions and 2 deletions.
  1. +3 −0 CHANGES.txt
  2. +2 −1 README.txt
  3. +1 −1 lib/Wing/Role/Result/Field.pm
View
@@ -4,6 +4,9 @@ This file tracks the changes to Wing over time. Especially
with respect to new features and compatibility changes.
==========================================================
2016-05-24
* If a field is defined as required or unique then we no longer allow empty string '' as a valid value.
2016-05-10
* Added a --force option to wing class --add so that you don't accidentally overwrite your classes.
* Added documentation for undocumented features of wing.angular.js.
View
@@ -31,7 +31,7 @@ INSTALLATION
5. Create a database on your MySQL server to host the project, and edit the Wing config to match:
NOTE: It is important that your my.cnf file for MySQL contain the following lines. If not, add them and restart it:
NOTE: It is important that your my.cnf file for MySQL contain the following lines in the [mysqld] section. If not, add them and restart it:
collation_server=utf8_unicode_ci
character_set_server=utf8
@@ -43,6 +43,7 @@ INSTALLATION
6. Modify the config file. You need to at least edit the "db" section to tell Wing how to log in to your database. You may also wish to update other settings.
vi /data/MyApp/etc/wing.conf
mkdir /data/apps/logs
chown nobody /data/apps/logs
NOTE: You can also edit the location of the logs in /data/MyApp/etc/log4perl.conf. It is defaultly set to /data/apps/logs/MyApp.log
@@ -197,7 +197,7 @@ sub wing_field {
return $params;
});
$class->meta->add_before_method_modifier($field => sub {
if (scalar @_ == 2 && ! defined $_[1]) {
if (scalar @_ == 2 && (! defined $_[1] || $_[1] eq '')) {
ouch 441, $field.' is required.', $field;
}
});

0 comments on commit 75bc67f

Please sign in to comment.