Flowdock
method

check_validity!

Importance_0
v3.2.8 - Show latest stable - 0 notes - Class: ActiveModel::Validations::LengthValidator
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 22
      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.