From: Ivan Tashkinov Date: Tue, 4 Dec 2018 16:24:41 +0000 (+0300) Subject: [#210] Refactoring. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=48e6193bf2c6a03068f1c6a96429fadffaa7794b;p=akkoma [#210] Refactoring. --- diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index a9e45f91e..c846dbd60 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -232,9 +232,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do with %Object{} = object <- Repo.get(Object, id), is_binary(description) do new_data = Map.put(object.data, "name", description) - - change = Object.change(object, %{data: new_data}) - {:ok, _} = Repo.update(change) + {:ok, _} = object |> Object.change(%{data: new_data}) |> Repo.update() end conn