Sha256: 5110868f27d318b03ce8be9e3cd70cda7cd85c237139e0164b4679dde693de51
Contents?: true
Size: 535 Bytes
Versions: 11
Compression:
Stored size: 535 Bytes
Contents
module Virtus class Attribute # Attribute extension which nullifies blank attributes when coercion failed # module NullifyBlank # @see [Attribute#coerce] # # @api public def coerce(input) output = super if !value_coerced?(output) && input.blank? nil # Added to nullify anything that is blank not just strings. elsif output.blank? nil else output end end end # NullifyBlank end # Attribute end # Virtus
Version data entries
11 entries across 11 versions & 1 rubygems