Sha256: 02077c0ad1cebe406f8ea67126be4387a4da6b1a73030943296cc3b9754e0dc0

Contents?: true

Size: 378 Bytes

Versions: 5

Compression:

Stored size: 378 Bytes

Contents

module Encore
  module Persister
    module ErrorsParser
      extend ActiveSupport::Concern

      def parse_errors(record, index)
        record.errors.messages.map do |field, values|
          {
            field: field.to_s,
            types: values,
            path: "#{record.class.name.underscore}/#{index}/#{field}"
          }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
encore-0.2.3 lib/encore/persister/errors_parser.rb
encore-0.2.2 lib/encore/persister/errors_parser.rb
encore-0.2.1 lib/encore/persister/errors_parser.rb
encore-0.2 lib/encore/persister/errors_parser.rb
encore-0.1 lib/encore/persister/errors_parser.rb