Improve relationship UI handling (#42)
* Added tabbed view; improved relationships for media profile * Adds new maybe_limit method for queries * Improves UI for media items, associated tasks
This commit is contained in:
@@ -3,6 +3,8 @@ defmodule Pinchflat.Repo do
|
||||
otp_app: :pinchflat,
|
||||
adapter: Ecto.Adapters.SQLite3
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
|
||||
@doc """
|
||||
It's not immediately obvious if an Oban job qualifies as unique, so this method
|
||||
attempts creating a job and checks for the `conflict?` field in the returned job.
|
||||
@@ -16,4 +18,13 @@ defmodule Pinchflat.Repo do
|
||||
err -> err
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
Applies a limit to a query if provided, otherwise returns the query as-is.
|
||||
|
||||
Returns %Ecto.Query{}.
|
||||
"""
|
||||
def maybe_limit(query, limit) do
|
||||
if limit, do: limit(query, ^limit), else: query
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user