Skip to content

Commit

Permalink
Improve docs and internal refs
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 8, 2020
1 parent bc43a3f commit 7dd9aee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions lib/ecto/parameterized_type.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,18 @@ defmodule Ecto.ParameterizedType do
@typedoc """
The parameters for the ParameterizedType
This is the value passed back from `c:init/1` and subsequently passed as the last argument to all callbacks.
Idiomatically it is a map.
This is the value passed back from `c:init/1` and subsequently passed
as the last argument to all callbacks. Idiomatically it is a map.
"""
@type params :: term()

@doc """
Callback to convert the options specified in the field macro into parameters to be used in other callbacks.
Callback to convert the options specified in the field macro into parameters
to be used in other callbacks.
This function is called at compile time, and should raise if invalid values are specified. It is idiomatic
that the parameters returned from this are a map. `field` and `schema` will be injected into the options
automatically
This function is called at compile time, and should raise if invalid values are
specified. It is idiomatic that the parameters returned from this are a map.
`field` and `schema` will be injected into the options automatically.
For example, this schema specification
Expand All @@ -110,18 +111,20 @@ defmodule Ecto.ParameterizedType do
@doc """
Loads the given term into a ParameterizedType.
For more information on loading, see `c:Ecto.Type.load/1`
For more information on loading, see `c:Ecto.Type.load/1`.
Note that this callback *will* be called when loading a `nil` value, unlike `c:Ecto.Type.load/1`.
Note that this callback *will* be called when loading a `nil` value,
unlike `c:Ecto.Type.load/1`.
"""
@callback load(value :: any(), loader :: function(), params()) :: {:ok, value :: any()} | :error

@doc """
Dumps the given term into an Ecto native type.
For more information on dumping, see `c:Ecto.Type.dump/1`
For more information on dumping, see `c:Ecto.Type.dump/1`.
Note that this callback *will* be called when dumping a `nil` value, unlike `c:Ecto.Type.dump/1`.
Note that this callback *will* be called when dumping a `nil` value,
unlike `c:Ecto.Type.dump/1`.
"""
@callback dump(value :: any(), dumper :: function(), params()) :: {:ok, value :: any()} | :error

Expand Down
2 changes: 1 addition & 1 deletion lib/ecto/query/planner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Ecto.Query.Planner do
raise "Ecto.Query match out of date in builder"
end

@parent_as 0
@parent_as __MODULE__

@doc """
Converts a query to a list of joins.
Expand Down

0 comments on commit 7dd9aee

Please sign in to comment.