You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I'd like to decorate_all functions that are injected by Ecto.Repo. I am struggling with this:
defmodule App.Repo do
use Ecto.Repo, otp_app: :app
use Decorator.Define
@decorate_all function_result(:test)
def function_result(add, body, _context) do
quote do
{unquote(add), unquote(body)}
end
end
(...)
Firstly, it seems not to work due to warning:
== Compilation error in file lib/app/repo.ex ==
** (ArgumentError) cannot make function __pool__/0 overridable because it was not defined
(elixir) lib/module.ex:913: anonymous fn/2 in Module.make_overridable/2
(stdlib) lists.erl:1338: :lists.foreach/2
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(stdlib) erl_eval.erl:228: :erl_eval.expr/5
(stdlib) erl_eval.erl:229: :erl_eval.expr/5
/lib/app/repo.ex:1: Decorator.Decorate.before_compile/1
Once I force filter out __pool__ function from decoration, it compiles but only few functions are decorated. Most of them are not
The text was updated successfully, but these errors were encountered:
Let's say I'd like to
decorate_all
functions that are injected byEcto.Repo
. I am struggling with this:Firstly, it seems not to work due to warning:
Once I force filter out
__pool__
function from decoration, it compiles but only few functions are decorated. Most of them are notThe text was updated successfully, but these errors were encountered: