Validate admin notification email.

This commit is contained in:
Douwe Maan 2015-10-18 11:58:59 +02:00
parent 3b1c702572
commit 551512b147
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ class ApplicationSetting < ActiveRecord::Base
allow_blank: true,
format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }
validates :admin_notification_email,
allow_blank: true,
email: true
validates_each :restricted_visibility_levels do |record, attr, value|
unless value.nil?
value.each do |level|