Closed bcardarella closed 8 years ago
I'd potentially argue that in the call to assert_valid_field
that the user should use the string, but this takes care of them using atoms :+1:
Ecto allows you to use param keys as atoms, they just can't be mixed with string keys
You'll have the inverse of this if in your changeset you use atoms. But, like you pointed out, if you are using Phoenix, you will likely be using strings in your changeset
In Ecto when you are attempting to cast params that have a mix of string and atoms Ecto raises an error: https://github.com/elixir-lang/ecto/blob/master/lib/ecto/changeset.ex#L428-L429
This fix will normalize all fields in the final param map to a string. Phoenix params come in with string keys so this should be the preferred normalization direction.