Sha256: 8af66f39828251d76ed9b61c970e4482233d67333e0a0145acaf7aaa9d42ed8f
Contents?: true
Size: 374 Bytes
Versions: 30
Compression:
Stored size: 374 Bytes
Contents
module Scimitar module Errors def add_errors_from_hash(errors_hash:, prefix: nil) errors_hash.each_pair do |key, value| new_key = prefix.nil? ? key : "#{prefix}.#{key}".to_sym if value.is_a?(Array) value.each {|error| errors.add(new_key, error)} else errors.add(new_key, value) end end end end end
Version data entries
30 entries across 30 versions & 2 rubygems