Sha256: 6314692f172eb93a3e88b8d41d773a2cb15d7b5455ca3227abde4634c367001f
Contents?: true
Size: 501 Bytes
Versions: 9
Compression:
Stored size: 501 Bytes
Contents
module ActiveModel module Validations # Adds support for validation to read attribute names like foo[0]. # Mainly used to validate collections. module CollectionItemsValidator::ArrayAttributeReader def read_attribute_for_validation(attribute) CollectionItemsValidator::ArrayAttributeGetter.get( attribute, when_array: -> (attribute_name, index) { super(attribute_name)[index] }, when_normal: -> { super } ) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems