🎉 It works!

pull/1200/head
Rick Carlino 2020-05-11 13:37:29 -05:00
parent 717a0d7544
commit 6ffbbe93d5
2 changed files with 13 additions and 3 deletions

View File

@ -14,7 +14,7 @@ defmodule FarmbotCeleryScript.Compiler do
@doc "Returns current debug mode value"
def debug_mode?() do
# Set this to `true` when debuging.
true
false
end
@valid_entry_points [:sequence, :rpc_request]

View File

@ -257,9 +257,19 @@ defmodule FarmbotCore.Asset do
# MARK AS steps.
# NOTE: Updating the `meta` attribute is a _replace_ action
# by default, not a merge action.
meta = Map.merge(point.meta || %{}, params[:meta] || %{})
# MORE NOTES: Mixed keys (symbol vs. string) will crash this FN.
# Let's just stringify everything...
new_meta = params[:meta] || params["meta"] || %{}
old_meta = point.meta || %{}
updated_meta = Map.merge(old_meta, new_meta)
clean_params = params
|> Map.merge(%{meta: updated_meta})
|> Enum.map(fn {k, v} -> {"#{k}", v} end)
|> Map.new()
IO.inspect(clean_params, label: "####### HMMMM")
Repo.get_by(Point, id: point.id)
|> Point.changeset(Map.merge(params, %{meta: meta}))
|> Point.changeset(clean_params)
|> Repo.update()
end