bh icon indicating copy to clipboard operation
bh copied to clipboard

In a nested form, options[:errors] can be nil

Open kakra opened this issue 10 years ago • 0 comments

The problem here is:

{ errors: nil }.fetch(:errors, {}) #==> nil

but the code expects:

({ errors: nil }.fetch(:errors) || {}) #==> {}

for the chained #fetch to work.

These patches fix the two problematic lines, though a more sophisticated patch should fix why in fields_for can the key exists with a nil value in first place.

kakra avatar Jul 10 '15 12:07 kakra