app/models/dlme_json.rb
# Given a hash with keys as strings and values as either arrays or hashes
Given a hash with keys as strings and values as either arrays or hashes
Given a hash with keys as strings and values as either arrays or hashes
def squash_errors(h)
    h.map do |k, v|
      if v.is_a? Hash
        "within '#{k}', #{squash_errors(v)}"
      else
        "'#{k}' #{v.to_sentence}"
      end
    end.join('. ')
  end
def squash_errors ( h ) h . map do | k , v | if v . is_a? Hash "within '#{k}', #{squash_errors(v)}" else "'#{k}' #{v.to_sentence}" end end . join ( '. ' ) end
Given a hash with keys as strings and values as either arrays or hashes
Given a hash with keys as strings and values as either arrays or hashes
h