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

Version Path
katello-4.15.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.15.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.0.rc3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.0.rc1.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.14.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb