14873: Custom JSON attributes that default to [] or {} when nil.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 2 Apr 2019 21:36:08 +0000 (18:36 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 2 Apr 2019 21:36:08 +0000 (18:36 -0300)
commit33021029867be4a2240f0d3673045dfac7598350
treee3d4f7698c978cb888d2a9e6e27a9b6f3315549f
parent4eaad199ac21e552eee2a049d33a3c076d8bed60
14873: Custom JSON attributes that default to [] or {} when nil.

Previously we used the 'serialize' call to declare a JSONB column as a Hash
or Array and this had the side effect to default to an empty hash or array
when assigning nil (whether was reading from the database or passed as a param).
JSONB columns shouldn't be now declared as serialized because Rails would serialize
their contents twice, but not declaring them makes us lose their side effect.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>
services/api/app/models/collection.rb
services/api/app/models/container.rb
services/api/app/models/container_request.rb
services/api/app/models/group.rb
services/api/app/models/jsonb_type.rb [new file with mode: 0644]
services/api/app/models/link.rb
services/api/app/models/node.rb
services/api/config/initializers/custom_types.rb [new file with mode: 0644]