diff --git a/lib/kaffy/resource_form.ex b/lib/kaffy/resource_form.ex index 664d31a3..29e1b427 100644 --- a/lib/kaffy/resource_form.ex +++ b/lib/kaffy/resource_form.ex @@ -93,7 +93,7 @@ defmodule Kaffy.ResourceForm do {:embed, %{cardinality: :one}} -> embed = Kaffy.ResourceSchema.embed_struct(schema, field) embed_fields = Kaffy.ResourceSchema.fields(embed) - embed_changeset = Ecto.Changeset.change(Map.get(data, field) || embed.__struct__) + embed_changeset = Ecto.Changeset.change(Map.get(data, field) || embed.__struct__()) inputs_for(form, field, fn fp -> [ diff --git a/lib/kaffy/resource_query.ex b/lib/kaffy/resource_query.ex index 2c80ee57..c88d91ab 100644 --- a/lib/kaffy/resource_query.ex +++ b/lib/kaffy/resource_query.ex @@ -163,7 +163,7 @@ defmodule Kaffy.ResourceQuery do term_type == :string do term = "%#{term}%" - from([..., r] in current_query, + from(r in current_query, or_where: ilike(type(field(r, ^f), :string), ^term) ) else @@ -171,7 +171,7 @@ defmodule Kaffy.ResourceQuery do term_type == :decimal do current_query else - from([..., r] in current_query, + from(r in current_query, or_where: field(r, ^f) == ^term ) end diff --git a/lib/kaffy_web/templates/home/_chart.html.eex b/lib/kaffy_web/templates/home/_chart.html.eex index dabbaf67..50aa2c23 100644 --- a/lib/kaffy_web/templates/home/_chart.html.eex +++ b/lib/kaffy_web/templates/home/_chart.html.eex @@ -9,9 +9,9 @@