Module: Encore::Persister::ErrorsParser

Extended by:
ActiveSupport::Concern
Included in:
Instance
Defined in:
lib/encore/persister/errors_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_errors(record, index) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/encore/persister/errors_parser.rb', line 6

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