Skip to content

Business intelligence made simple

Sub ; with , for check emails

Andrew Kane25194f8f7bfb
diff --git a/app/models/blazer/check.rb b/app/models/blazer/check.rb
index 666cfb1f..ff7d3c8b 100644
--- a/app/models/blazer/check.rb
+++ b/app/models/blazer/check.rb
@@ -6,6 +6,7 @@ module Blazer
validates :query_id, presence: true
before_validation :set_state
+ before_validation :fix_emails
def set_state
self.state ||= "new"
@@ -15,6 +16,12 @@ module Blazer
emails.to_s.downcase.split(",").map(&:strip)
end
+ def fix_emails
+ # some people like doing ; instead of ,
+ # but we know what they mean, so let's fix it
+ self.emails = emails.gsub(";", ",") if emails.present?
+ end
+
def update_state(result)
check_type =
if respond_to?(:check_type)