ar_doc_store icon indicating copy to clipboard operation
ar_doc_store copied to clipboard

`multiple: true` attributes do not default to `[]`

Open Qqwy opened this issue 6 years ago • 1 comments

When having an attribute like

json_attribute colors, :string, multiple: true

then this field will still default to nil, instead of to an empty array ([]). This goes against the principle of least astonishment, so I suggest to change this.

And if you disagree and believe that nil is a good default value even for arrays, then in that case it at least makes sense to improve the documentation on that matter :slightly_smiling_face: .

And let me know if I can help with e.g. making a PR for this; I'll happily do so!

Qqwy avatar May 28 '19 10:05 Qqwy

Sorry for the delay! Thank you for noticing the issue. Empty array sounds good. PR accepted happily!

dfurber avatar Nov 18 '19 14:11 dfurber