Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2014 00:18:52 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r264575 - user/des/fbp/lib/FBP/Schema/Result
Message-ID:  <201404170018.s3H0IqEA018450@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Thu Apr 17 00:18:51 2014
New Revision: 264575
URL: http://svnweb.freebsd.org/changeset/base/264575

Log:
  Enforce poll start / end dates in the model.

Modified:
  user/des/fbp/lib/FBP/Schema/Result/Poll.pm

Modified: user/des/fbp/lib/FBP/Schema/Result/Poll.pm
==============================================================================
--- user/des/fbp/lib/FBP/Schema/Result/Poll.pm	Wed Apr 16 23:41:25 2014	(r264574)
+++ user/des/fbp/lib/FBP/Schema/Result/Poll.pm	Thu Apr 17 00:18:51 2014	(r264575)
@@ -210,6 +210,8 @@ sub validate_answer($%) {
 sub commit_answer($$%) {
     my ($self, $voter, %answers) = @_;
 
+    die("You cannot vote in an inactive poll\n")
+	unless $self->active;
     foreach my $question ($self->questions) {
 	$question->commit_answer($voter, @{$answers{$question->id}});
     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404170018.s3H0IqEA018450>