Class Index [+]

Quicksearch

ActiveModel::Validations::ExclusionValidator

Public Instance Methods

check_validity!() click to toggle source
   # File lib/active_model/validations/exclusion.rb, line 6
6:       def check_validity!
7:         raise ArgumentError, "An object with the method include? is required must be supplied as the " <<
8:                              ":in option of the configuration hash" unless options[:in].respond_to?(:include?)
9:       end
validate_each(record, attribute, value) click to toggle source
    # File lib/active_model/validations/exclusion.rb, line 11
11:       def validate_each(record, attribute, value)
12:         if options[:in].include?(value)
13:           record.errors.add(attribute, :exclusion, options.except(:in).merge!(:value => value))
14:         end
15:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.