Sha256: de5283c9b93b4aa448b1fe7f84105965b7fa626b9351f3430ff27affa5f2bb98
Contents?: true
Size: 486 Bytes
Versions: 8
Compression:
Stored size: 486 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 && !(value.strip == value) record.errors[attribute] << _("must not contain leading or trailing white spaces.") end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems