Sha256: c9afff4a44b4a319d7ae5c2648e71264c4c935f8182a17884f66a10c6cdef732
Contents?: true
Size: 487 Bytes
Versions: 238
Compression:
Stored size: 487 Bytes
Contents
module Katello module Validators class NoTrailingSpaceValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) NoTrailingSpaceValidator.validate_trailing_space(record, attribute, value) end def self.validate_trailing_space(record, attribute, value) if value record.errors[attribute] << _("must not contain leading or trailing white spaces.") unless value.strip == value end end end end end
Version data entries
238 entries across 238 versions & 1 rubygems