Skip to content

Commit

Permalink
Use clickhousex master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIvanoff committed May 27, 2020
1 parent e4e6bb6 commit bd762a9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
2 changes: 0 additions & 2 deletions lib/sanbase/application.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
defmodule Sanbase.Application do
use Application

import Sanbase.ApplicationUtils

require Logger
require Sanbase.Utils.Config, as: Config

Expand Down
8 changes: 6 additions & 2 deletions lib/sanbase/user_lists/watchlist_function.ex
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
defmodule Sanbase.WatchlistFunction do
use Vex.Struct
use Ecto.Type

defstruct name: "empty", args: []

alias Sanbase.Model.Project

@behaviour Ecto.Type
@impl Ecto.Type
def type, do: :map

def evaluate(%__MODULE__{name: "market_segment", args: args}) do
Expand Down Expand Up @@ -50,10 +50,12 @@ defmodule Sanbase.WatchlistFunction do

def empty(), do: %__MODULE__{name: "empty", args: []}

@impl Ecto.Type
def cast(function) when is_binary(function) do
parse(function)
end

@impl Ecto.Type
def cast(%__MODULE__{} = function), do: {:ok, function}

def cast(%{} = function) do
Expand All @@ -67,6 +69,7 @@ defmodule Sanbase.WatchlistFunction do

def cast(_), do: :error

@impl Ecto.Type
def load(function) when is_map(function) do
function =
for {key, val} <- function do
Expand All @@ -76,6 +79,7 @@ defmodule Sanbase.WatchlistFunction do
{:ok, struct!(__MODULE__, function)}
end

@impl Ecto.Type
def dump(%__MODULE__{} = function), do: {:ok, Map.from_struct(function)}
def dump(_), do: :error

Expand Down
16 changes: 6 additions & 10 deletions lib/sanbase_web/admin/auth/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ defmodule Sanbase.ExAdmin.Auth.User do
alias Sanbase.Auth.EthAccount
alias Sanbase.Insight.Post

@environment Mix.env()

register_resource Sanbase.Auth.User do
controller do
before_filter(:assign_all_user_insights_to_anonymous, only: [:destroy])
Expand All @@ -19,14 +17,12 @@ defmodule Sanbase.ExAdmin.Auth.User do
column(:id, link: true)
column(:address)

unless @environment == :dev do
column("San balance", fn eth_account ->
case EthAccount.san_balance(eth_account) do
nil -> ""
san_balance -> san_balance |> Decimal.to_string()
end
end)
end
column("San balance", fn eth_account ->
case EthAccount.san_balance(eth_account) do
nil -> ""
san_balance -> san_balance
end
end)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/sanbase_web/graphql/resolvers/user/user_resolver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ defmodule SanbaseWeb.Graphql.Resolvers.UserResolver do
is_registered: true
})
)
|> Multi.run(:add_eth_account, fn %{add_user: %User{id: id}} ->
|> Multi.run(:add_eth_account, fn _repo, %{add_user: %User{id: id}} ->
eth_account =
EthAccount.changeset(%EthAccount{}, %{user_id: id, address: address})
|> Repo.insert()
Expand Down
7 changes: 2 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ defmodule Sanbase.Mixfile do
{:async_with, github: "fertapric/async_with"},
{:basic_auth, "~> 2.2"},
{:clickhouse_ecto, github: "santiment/clickhouse_ecto", branch: "migrate-ecto-3"},
{:clickhousex,
github: "ivanivanoff/clickhousex",
branch: "revert-17-revert-15-prepare_for_ecto_3",
override: true},
{:clickhousex, github: "ivanivanoff/clickhousex", override: true},
{:con_cache, "~> 0.13"},
{:corsica, "~> 1.0"},
{:cowboy, "~> 2.0"},
Expand All @@ -62,7 +59,7 @@ defmodule Sanbase.Mixfile do
{:dialyxir, "~> 1.0.0-rc.6", only: [:dev], runtime: false},
{:distillery, "~> 2.0", runtime: false},
{:earmark, "~> 1.2"},
{:ecto_enum, "~> 1.3"},
{:ecto_enum, "~> 1.4"},
{:ecto, "~> 3.0"},
{:ecto_sql, "~> 3.0"},
{:envy, "~> 1.1.1", only: [:dev, :test]},
Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"castore": {:hex, :castore, "0.1.5", "591c763a637af2cc468a72f006878584bc6c306f8d111ef8ba1d4c10e0684010", [:mix], [], "hexpm", "6db356b2bc6cc22561e051ff545c20ad064af57647e436650aa24d7d06cd941a"},
"certifi": {:git, "https://github.com/certifi/erlang-certifi", "e08b12e8993502240c25b78563993776f87ecd2a", [tag: "2.5.1"]},
"clickhouse_ecto": {:git, "https://github.com/santiment/clickhouse_ecto.git", "9518142275534f040edb19c61646fc3aed889040", [branch: "migrate-ecto-3"]},
"clickhousex": {:git, "https://github.com/ivanivanoff/clickhousex.git", "1a3b25080fa755f1e5d68803e01a548c2995920f", [branch: "revert-17-revert-15-prepare_for_ecto_3"]},
"clickhousex": {:git, "https://github.com/ivanivanoff/clickhousex.git", "d138f85c53a102059af1a682fc8dc4aabdf10b66", []},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
"con_cache": {:hex, :con_cache, "0.14.0", "863acb90fa08017be3129074993af944cf7a4b6c3ee7c06c5cd0ed6b94fbc223", [:mix], [], "hexpm", "50887a8949377d0b707a3c6653b7610de06074751b52d0f267f52135f391aece"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},
Expand All @@ -32,8 +32,8 @@
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
"earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
"ecto": {:hex, :ecto, "3.4.4", "a2c881e80dc756d648197ae0d936216c0308370332c5e77a2325a10293eef845", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4bd3ad62abc3b21fb629f0f7a3dab23a192fca837d257dd08449fba7373561"},
"ecto_enum": {:hex, :ecto_enum, "1.3.2", "659f7251b6a201a236db9dceef0f713319f095a23ad1d8718efd7a3d3ef3e21b", [:mix], [{:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, ">= 0.0.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "7d111aef5601596f1c6da3fd1de784cb7ed7f8eca3f8af631df04f11fc8f248f"},
"ecto_sql": {:hex, :ecto_sql, "3.4.3", "c552aa8a7ccff2b64024f835503b3155d8e73452c180298527fbdbcd6e79710b", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.0", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ec9e59d6fa3f8cfda9963ada371e9e6659167c2338a997bd7ea23b10b245842b"},
"ecto_enum": {:hex, :ecto_enum, "1.4.0", "d14b00e04b974afc69c251632d1e49594d899067ee2b376277efd8233027aec8", [:mix], [{:ecto, ">= 3.0.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "> 3.0.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:mariaex, ">= 0.0.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "8fb55c087181c2b15eee406519dc22578fa60dd82c088be376d0010172764ee4"},
"ecto_sql": {:hex, :ecto_sql, "3.4.4", "d28bac2d420f708993baed522054870086fd45016a9d09bb2cd521b9c48d32ea", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.4.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.0", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "edb49af715dd72f213b66adfd0f668a43c17ed510b5d9ac7528569b23af57fe8"},
"envy": {:hex, :envy, "1.1.1", "0bc9bd654dec24fcdf203f7c5aa1b8f30620f12cfb28c589d5e9c38fe1b07475", [:mix], [], "hexpm", "7061eb1a47415fd757145d8dec10dc0b1e48344960265cb108f194c4252c3a89"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_admin": {:git, "https://github.com/IvanIvanoff/ex_admin.git", "6a520b3c0c2662960801865cdfd6a2085914909a", [branch: "apply-changes"]},
Expand Down

0 comments on commit bd762a9

Please sign in to comment.