Module: Reform::Contract::Errors::Merge
- Included in:
- Reform::Contract::Errors
- Defined in:
- lib/reform/contract/errors.rb
Instance Method Summary collapse
Instance Method Details
#merge!(errors, prefix) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/reform/contract/errors.rb', line 7 def merge!(errors, prefix) errors..each do |field, msgs| unless field.to_sym == :base field = (prefix+[field]).join(".").to_sym # TODO: why is that a symbol in Rails? end msgs.each do |msg| next if [field] and [field].include?(msg) add(field, msg) end # Forms now contains a plain errors hash. the errors for each item are still available in item.errors. end end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/reform/contract/errors.rb', line 20 def to_s .inspect end |