Rummage.Ecto v2.0.0 Rummage.Ecto.Config View Source
This module encapsulates all the Rummage's runtime configurations that can be set in the config.exs file.
This configuration is optional, as Rummage.Ecto
can accept the same
arguments as optional arguments to the function Rummage.Ecto.rummage/3
Usage:
A basic example without overriding default hooks:
config.exs:
config :app_name, Rummage.Ecto,
per_page: 10,
repo: AppName.Repo
This is a more advanced usage where you can specify the default hooks:
config.exs:
config :app_name, Rummage.Ecto,
per_page: 10,
repo: AppName.Repo,
search: Rummage.Ecto.Hook.Search,
sort: Rummage.Ecto.Hook.Sort,
paginate: Rummage.Ecto.Hook.Paginate
Link to this section Summary
Functions
:paginate
hook can also be set at run time
in the config.exs
file
:per_page
can also be set at run time
in the config.exs
file
:repo
can also be set at run time
in the config.exs file
:search
hook can also be set at run time
in the config.exs
file. This pulls the configuration
assocated with the application, application
. When no
application is given this defaults to rummage_ecto
.
:sort
hook can also be set at run time
in the config.exs
file
Link to this section Functions
:paginate
hook can also be set at run time
in the config.exs
file
Examples
When no config is set, if returns the default hook
(Rummage.Ecto.Hook.Paginate
):
iex> alias Rummage.Ecto.Config
iex> Config.paginate
Rummage.Ecto.Hook.Paginate
:per_page
can also be set at run time
in the config.exs
file
Examples
Returns default Repo
set in the config
(2 in rummage_ecto
's test env):
iex> alias Rummage.Ecto.Config
iex> Config.per_page
2
:repo
can also be set at run time
in the config.exs file
Examples
Returns default Repo
set in the config
(Rummage.Ecto.Repo
in rummage_ecto
's test env):
iex> alias Rummage.Ecto.Config
iex> Config.repo
Rummage.Ecto.Repo
:search
hook can also be set at run time
in the config.exs
file. This pulls the configuration
assocated with the application, application
. When no
application is given this defaults to rummage_ecto
.
Examples
When no config is set, if returns the default hook
(Rummage.Ecto.Hook.Search
):
iex> alias Rummage.Ecto.Config
iex> Config.search
Rummage.Ecto.Hook.Search
:sort
hook can also be set at run time
in the config.exs
file
Examples
When no config is set, if returns the default hook
(Rummage.Ecto.Hook.Sort
):
iex> alias Rummage.Ecto.Config
iex> Config.sort
Rummage.Ecto.Hook.Sort