Sha256: d00514ff37fc2af5964233398351871edd77bf182e41792591de2d5514b25d98
Contents?: true
Size: 586 Bytes
Versions: 245
Compression:
Stored size: 586 Bytes
Contents
module Katello module Validators class KatelloUrlFormatValidator < ActiveModel::EachValidator include KatelloUrlHelper def validate_each(record, attribute, value) if options[:nil_allowed] if options[:nil_allowed].respond_to?(:call) return if value.nil? && options[:nil_allowed].call(record) else return if value.nil? end end attribute_name = options[:field_name] || attribute record.errors[attribute_name] << N_("is invalid") unless kurl_valid?(value) end end end end
Version data entries
245 entries across 245 versions & 1 rubygems