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

Version Path
katello-4.7.6 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.9.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.9.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.5 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.4 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.6.2.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.6.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.6.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.7.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.4.2.2 app/lib/katello/validators/no_trailing_space_validator.rb