   end
 
   def update(%Changeset{} = changeset) do
-    resource = repo.update changeset.changeset
+    {:ok, resource} = repo.update changeset.changeset
     
     for {cs, fun} <- changeset.dependents do
       if cs do

  def get_assoc_model(resource, field) do
    case get_assoc_join_model(resource, field) do
      {:ok, {assoc, second}} -> 
        {assoc.__schema__(:association, second).assoc, assoc}
      error ->  
        error
    end

      %{through: [first, _]} -> 
        # assoc_model =  res_model.__schema__(:association, first).assoc_key
        {:ok, {
          res_model.__schema__(:association, first).related_key, 
          res_model.__schema__(:association, first).related.related_key, 
        }}
      _ -> 
        {:error, :notfound}
