check_validity!() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/validations/length.rb, line 23
      def check_validity!
        keys = CHECKS.keys & options.keys

        if keys.empty?
          raise ArgumentError, 'Range unspecified. Specify the :in, :within, :maximum, :minimum, or :is option.'
        end

        keys.each do |key|
          value = options[key]

          unless value.is_a?(Integer) && value >= 0
            raise ArgumentError, ":#{key} must be a nonnegative Integer"
          end
        end
      end
Register or log in to add new notes.