diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-18 17:31:31 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-18 17:31:31 +0100 |
commit | 611f0fc992503b9332ea1e5bb0f5df55d031d8ac (patch) | |
tree | 9ea1c59d54c5b7a2d56e366220f658f9344c9c3f /perllib/FixMyStreet/DB/Result/Comment.pm | |
parent | c40da27da59b74c32db0a50a2a03473ec4cdba2c (diff) |
redo validation and storage to be more in line with code in report/new
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 0ba034927..6eefb30b2 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -73,4 +73,15 @@ __PACKAGE__->belongs_to( # You can replace this text with custom code or comments, and it will be preserved on regeneration + +sub check_for_errors { + my $self = shift; + + my %errors = (); + + $errors{update} = _('Please enter a message') + unless $self->text =~ m/\S/; + + return \%errors; +} 1; |