-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix validation of form name and description when empty
- Added "not_empty" validation rule to name - Always check validation for name - Added migration allowing null for description - Add a test for setting form.name to empty
- Loading branch information
1 parent
2fe2a73
commit 2ac537b
Showing
4 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
migrations/20170630084848_allow_null_in_description_forms.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class AllowNullInDescriptionForms extends AbstractMigration | ||
{ | ||
/** | ||
* Migrate Up. | ||
*/ | ||
public function up() | ||
{ | ||
$this->table('forms') | ||
->changeColumn('description', 'text', ['null' => true]) | ||
->save(); | ||
} | ||
|
||
/** | ||
* Migrate Down. | ||
*/ | ||
public function down() | ||
{ | ||
$this->table('forms') | ||
->changeColumn('description', 'text', ['null' => false]) | ||
->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters