Class: ActiveModel::ErrorCollecting::MachineArrayReporter
Instance Attribute Summary
Attributes inherited from Reporter
#collection
Instance Method Summary
collapse
Methods inherited from Reporter
#base, #initialize
Instance Method Details
10
11
12
13
14
15
16
|
# File 'lib/active_model/error_collecting/machine_array_reporter.rb', line 10
def format_error_message(error_message)
result = {}
result[:attribute] = error_message.attribute.to_s
result[:type] = error_message.type || :invalid
result[:options] = error_message.options unless error_message.options.blank?
result
end
|
#to_a ⇒ Object
4
5
6
7
8
|
# File 'lib/active_model/error_collecting/machine_array_reporter.rb', line 4
def to_a
collection.to_a.map do |error_message|
format_error_message error_message
end
end
|