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.13.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.13.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.12.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.13.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.12.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.12.0.rc3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.12.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.12.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.11.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.11.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.11.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.11.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.10.0 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.9.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.10.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.10.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.4 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.9.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.8.3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.9.0 app/lib/katello/validators/no_trailing_space_validator.rb