Method: ActiveModel::Validations::ClassMethods#inherited

Defined in:
lib/active_model/validations.rb

#inherited(base) ⇒ Object

Copy validators on inheritance.



287
288
289
290
291
# File 'lib/active_model/validations.rb', line 287

def inherited(base) # :nodoc:
  dup = _validators.dup
  base._validators = dup.each { |k, v| dup[k] = v.dup }
  super
end