vic / params

Easy parameters validation/casting with Ecto.Schema, akin to Rails' strong parameters.
http://hex.pm/packages/params
Apache License 2.0
364 stars 47 forks source link

Fixed to_map for nested schemas #8

Closed lasseebert closed 8 years ago

lasseebert commented 8 years ago

Found a bug with nested schemas when params was actually submitted.

I'm not really sure why this bug is.

It seems that when creating changeset from empty params and the schema has nested default values, data will contain maps of the nested data. When actually using a filled params, data will use structs for the nested data.

This fixes it, but I'm unsure if I only fixed the symptom.