mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
more straightforward usage of array_replace
This commit is contained in:
parent
b62a723efe
commit
bc6965485a
3 changed files with 4 additions and 3 deletions
|
@ -241,10 +241,11 @@ defmodule Philomena.Tags do
|
|||
set: [
|
||||
{
|
||||
^column,
|
||||
fragment("ARRAY(SELECT DISTINCT unnest(array_replace(?, ?, ?)) ORDER BY 1)", field(q, ^column), ^old_value, ^new_value)
|
||||
fragment("array_replace(?, ?, ?)", field(q, ^column), ^old_value, ^new_value)
|
||||
}
|
||||
]
|
||||
)
|
||||
|> IO.inspect()
|
||||
|> Repo.update_all([])
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ defmodule PhilomenaWeb.Image.CommentController do
|
|||
plug :load_and_authorize_resource, model: Image, id_name: "image_id", persisted: true
|
||||
|
||||
# Undo the previous private parameter screwery
|
||||
plug PhilomenaWeb.LoadCommentPlug, [param: "id"] when action in [:edit, :update]
|
||||
plug PhilomenaWeb.LoadCommentPlug, [param: "id"] when action in [:show, :edit, :update]
|
||||
plug PhilomenaWeb.CanaryMapPlug, create: :create, edit: :edit, update: :edit
|
||||
plug :authorize_resource, model: Comment, only: [:show, :edit, :update], preload: [:image, user: [awards: :badge]]
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ defmodule PhilomenaWeb.Tag.AliasController do
|
|||
|
||||
conn
|
||||
|> put_flash(:info, "Tag alias queued.")
|
||||
|> redirect(to: Routes.tag_path(conn, :show, conn.assigns.tag))
|
||||
|> redirect(to: Routes.tag_alias_path(conn, :edit, conn.assigns.tag))
|
||||
end
|
||||
|
||||
def delete(conn, _params) do
|
||||
|
|
Loading…
Reference in a new issue