Current section

27 Versions

Jump to

Compare versions

3 files changed
+9 additions
-4 deletions
  @@ -20,4 +20,4 @@
20 20 {<<"optional">>,false},
21 21 {<<"repository">>,<<"hexpm">>},
22 22 {<<"requirement">>,<<"~> 1.0">>}]]}.
23 - {<<"version">>,<<"0.7.0">>}.
23 + {<<"version">>,<<"0.7.1">>}.
  @@ -6,7 +6,7 @@ defprotocol Ecto.DevLogger.PrintableParameter do
6 6
7 7 `Ecto.DevLogger` tries to represent complex terms, like arrays (lists) and composite types (tuples)
8 8 as string literal first. Not all terms are easy/efficient/whatever to represent as strings, so if
9 - for all elemements inside the array `to_string_literal/1` returns a string,
9 + `to_string_literal/1` returns a string for all elements inside the array,
10 10 then array will be represented as string as well. Otherwise, array will be represented using `ARRAY` constructor:
11 11
12 12 iex> Ecto.DevLogger.PrintableParameter.to_expression(["Elixir", "Ecto"])
  @@ -59,10 +59,15 @@ defmodule Ecto.DevLogger.Utils do
59 59 end
60 60
61 61 defimpl Ecto.DevLogger.PrintableParameter, for: Atom do
62 - def to_expression(atom), do: to_string_literal(atom)
62 + def to_expression(nil), do: "NULL"
63 + def to_expression(true), do: "true"
64 + def to_expression(false), do: "false"
65 + def to_expression(atom), do: atom |> Atom.to_string() |> Ecto.DevLogger.Utils.in_string_quotes()
66 +
63 67 def to_string_literal(nil), do: "NULL"
64 68 def to_string_literal(true), do: "true"
65 69 def to_string_literal(false), do: "false"
70 + def to_string_literal(atom), do: Atom.to_string(atom)
66 71 end
67 72
68 73 defimpl Ecto.DevLogger.PrintableParameter, for: Map do
  @@ -1,6 +1,6 @@
1 1 defmodule Ecto.DevLogger.MixProject do
2 2 use Mix.Project
3 - @version "0.7.0"
3 + @version "0.7.1"
4 4 @source_url "https://github.com/fuelen/ecto_dev_logger"
5 5
6 6 def project do