This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
config :my_app_api, MyAppApi.Endpoint, | |
url: [host: "api.%%%%.app"], | |
secret_key_base: "%%%%", | |
render_errors: [view: MyAppApi.ErrorView, accepts: ~w(html json)], | |
pubsub: [name: MyAppApi.PubSub, adapter: Phoenix.PubSub.PG2], | |
live_view: [signing_salt: "%%%%"] | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ** (Ecto.Query.CompileError) Tuples can only be used in comparisons with literal tuples of the same size | |
def search(query_string, offset \\ 0, limit \\ 0, | |
media_category, | |
playlist_uuid, | |
channel_uuid, | |
published_after | |
) do | |
conditions = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
direction = :asc | |
sorting = :track_number | |
# direction = :desc | |
# sorting = :presented_at | |
media_category = Ecto.Query.from(playlist in Playlist, | |
where: playlist.uuid == ^playlist_uuid, | |
select: playlist.media_category) | |
|> Repo.one | |
|> IO.inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule YourAppName.Search do | |
# ... | |
@doc """ | |
Queries listings. | |
""" | |
def query_listings(query, current_user) do | |
default_scope = from l in Listing, where: l.draft == false or l.user_id == ^current_user.id, order_by: [desc: l.updated_at], limit: 50 | |
id = _try_integer(query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes chunk: | |
``` | |
# ---- Pipelines ---- | |
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session | |
plug :fetch_flash | |
plug :protect_from_forgery | |
plug :put_secure_browser_headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Phoenix.Template.UndefinedError at GET / | |
Could not render "app.html" for WordApi.LayoutView, please define a matching clause for render/2 or define a template at "lib/faithful_word_api/templates/layout". No templates were compiled for this module. Assigns: | |
%{__phx_template_not_found__: WordApi.LayoutView, conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{layout: {WordApi.LayoutView, "app.html"}}, before_send: [#Function<0.116269836/1 in Plug.CSRFProtection.call/2>, #Function<2.65282597/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.58261320/1 in Plug.Session.before_send/2>, #Function<1.112466771/1 in Plug.Logger.call/2>, #Function<0.66982185/1 in Phoenix.LiveReloader.before_send_inject_reloader/2>], body_params: %{}, cookies: %{"cookieconsent_status" => "dismiss"}, halted: false, host: "localhost", method: "GET", owner: #PID<0.736.0>, params: %{}, path_info: [], path_params: %{}, port: 4000, private: %{WordApi.Router => {[], %{}}, :phoenix_action => :index, :phoenix_controller => WordApi.Pa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecto.Query.from(fer in Transfer, | |
join: tn in Transaction, | |
where: fer.transaction_id == tn.id, | |
order_by: tn.absolute_id, | |
select: %{title: tn.basename, localizedTitle: fer.localizedname, uuid: tn.uuid, languageId: fer.language_id}) | |
|> Repo.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Sphinx configuration file sample | |
# | |
# WARNING! While this sample file mentions all available options, | |
# it contains (very) short helper descriptions only. Please refer to | |
# doc/sphinx.html for details. | |
# | |
############################################################################# | |
## data source definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.docker.com/compose/compose-file/ | |
version: '3.7' | |
services: | |
app_name: | |
build: . | |
depends_on: | |
- postgres | |
environment: | |
DATABASE_URL: ecto://app_name:app_name@postgres/app_name | |
HOSTNAME: localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST=localhost | |
DATABASE_URL=ecto://nevermind:nevermind@olivetree-db/olivetree_prod?pool_size=15 | |
PORT=5000 | |
POSTGRES_USER=nevermind | |
POSTGRES_PASSWORD=nevermind | |
POSTGRES_DB=olivetree_prod | |
POSTGRES_HOST=postgres | |