Skip to content

Commit aebec4d

Browse files
committed
fix: Allow custom ecto types with string type underneath (#136)
1 parent 0dd35bb commit aebec4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/kaffy/resource_form.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ defmodule Kaffy.ResourceForm do
289289

290290
fields = Kaffy.ResourceSchema.fields(assoc)
291291

292-
string_fields = Enum.filter(fields, fn {_f, options} -> options.type == :string end)
292+
string_fields =
293+
Enum.filter(fields, fn {_f, options} ->
294+
options.type == :string or
295+
(Kaffy.Utils.is_module(options.type) and
296+
Kernel.function_exported?(options.type, :type, 0) and
297+
options.type.type == :string)
298+
end)
293299

294300
popular_strings =
295301
string_fields

0 commit comments

Comments
 (0)