title: Ecto - updating nested embed
body: <p>I can't update nested settings with ecto, I either get "no changes" changeset or errors. Migration:</p>
  
  <pre><code>def change do
    create table(:trees) do
    ...
    add :settings, :map
  </code></pre>
  
  <p>Settings looks like:</p>
  
  <pre><code>defmodule Final.TreeSettings do
    use Ecto.Schema
  
    embedded_schema do
      ...
      field :columns, :map       
      timestamps
    end
  end
  </code></pre>
  
  <p><strong>Notice the nested columns map.</strong></p>
  
  <p>I can insert new Tree row easily like:</p>
  
  <pre><code>changeset = Tree.changeset(%Tree{}, %{user_id: user_id, name: x})
        |&gt; Ecto.Changeset.put_embed(:settings, treeSettings)
  </code></pre>
  
  <p>But updating it the same way doesn't work:</p>
  
  <pre><code>get_tree = Repo.one! from p in Tree, where: p.name == ^tree["name"], where: p.user_id == ^user_id
  settingss = get_tree.settings
  settingss = Kernel.update_in(settingss.columns[tree["setting"]][tree["type"]], fn x -&gt; "asdasd" end)
  # IO.inspect(settingss) shows correct changes here.
  changeset =
      get_tree
      |&gt; Ecto.Changeset.change
      |&gt; Ecto.Changeset.put_embed(:settings, settingss)    
      IO.inspect changeset
  </code></pre>
  
  <p>Gives: </p>
  
  <pre><code>#Ecto.Changeset&lt;action: nil, changes: %{}, errors: [], data: #Final.Tree&lt;&gt;,
   valid?: true&gt;
  </code></pre>