summaryrefslogtreecommitdiff
path: root/help/app/models/ticket.rb
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-12-31 13:05:39 -0800
committerjessib <jessib@leap.se>2012-12-31 13:05:39 -0800
commitbf80482c34034a59307193ced0dcfac7db05f055 (patch)
tree6d656ca312d161b9c3cf02ef0400eb501dd97e07 /help/app/models/ticket.rb
parent9a23a5d63b2b5bcb1994137a5de9f8ebd88142f1 (diff)
Client-side validations, including only validating email address format if something is input for email address.
Diffstat (limited to 'help/app/models/ticket.rb')
-rw-r--r--help/app/models/ticket.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/help/app/models/ticket.rb b/help/app/models/ticket.rb
index fa056b4..0399b4e 100644
--- a/help/app/models/ticket.rb
+++ b/help/app/models/ticket.rb
@@ -132,7 +132,7 @@ class Ticket < CouchRest::Model::Base
# html5 has built-in validation which isn't ideal, as it says 'please enter an email address' for invalid email addresses, which implies an email address is required, and it is not.
- validates :email, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/, :if => :email #email address is optional
+ validates :email, :allow_blank => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/ #email address is optional
#TODO:
#def set_created_by