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.3.0.rc2.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.3.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.3.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.0.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.4 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.0.3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.0.1.rc3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-3.18.5 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.0.1.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.0.rc2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.3 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.2.0.rc1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.0.2.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.2.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.0.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.2 app/lib/katello/validators/no_trailing_space_validator.rb
katello-3.18.4 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.1 app/lib/katello/validators/no_trailing_space_validator.rb
katello-4.1.0 app/lib/katello/validators/no_trailing_space_validator.rb