drop to 15 records per page
This commit is contained in:
@@ -6,7 +6,7 @@ defmodule ActionRequestsDemo.ActionRequests.ActionRequest do
|
||||
Flop.Schema,
|
||||
filterable: [:patient_name, :status, :assigned_user_id],
|
||||
sortable: [:patient_name, :status, :inserted_at, :delivery_scheduled_at],
|
||||
default_limit: 25
|
||||
default_limit: 15
|
||||
}
|
||||
|
||||
@primary_key {:id, :binary_id, autogenerate: true}
|
||||
|
||||
@@ -19,12 +19,52 @@ defmodule ActionRequestsDemo.Release do
|
||||
`priv/repo/seeds.exs` file, which uses `ActionRequestsDemo.Repo`.
|
||||
"""
|
||||
def seed do
|
||||
# Ensure Faker is started in this eval process so Faker.Person.name/0 works
|
||||
{:ok, _} = Application.ensure_all_started(:faker)
|
||||
ensure_app_started(ActionRequestsDemo.Repo)
|
||||
ensure_app_started(:faker)
|
||||
|
||||
seeds_path = Application.app_dir(@app, "priv/repo/seeds.exs")
|
||||
Code.require_file(seeds_path)
|
||||
end
|
||||
|
||||
defp ensure_app_started(app_or_repo) do
|
||||
case Application.ensure_all_started(app_or_repo) do
|
||||
{:ok, _} ->
|
||||
:ok
|
||||
|
||||
{:error, {:already_started, _pid}} ->
|
||||
:ok
|
||||
|
||||
{:error, {:not_started, _}} ->
|
||||
start_repo(app_or_repo)
|
||||
|
||||
{:error, reason} ->
|
||||
raise "Could not start #{inspect(app_or_repo)}: #{inspect(reason)}"
|
||||
end
|
||||
rescue
|
||||
UndefinedFunctionError ->
|
||||
start_repo(app_or_repo)
|
||||
end
|
||||
|
||||
defp start_repo(repo) when is_atom(repo) do
|
||||
case repo.start_link() do
|
||||
{:ok, _pid} ->
|
||||
:ok
|
||||
|
||||
{:error, {:already_started, _pid}} ->
|
||||
:ok
|
||||
|
||||
other ->
|
||||
raise "Could not start #{inspect(repo)}: #{inspect(other)}"
|
||||
end
|
||||
end
|
||||
|
||||
defp start_repo(app) do
|
||||
case Application.ensure_all_started(app) do
|
||||
{:ok, _} -> :ok
|
||||
{:error, {:already_started, _}} -> :ok
|
||||
other -> raise "Could not start #{inspect(app)}: #{inspect(other)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user