Sha256: 86d0ca09534181768f0eca6ddd062d2bea29460363566183c42383b90cad03f2
Contents?: true
Size: 554 Bytes
Versions: 10
Compression:
Stored size: 554 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? && output != false nil else output end end end # NullifyBlank end # Attribute end # Virtus
Version data entries
10 entries across 10 versions & 1 rubygems