Closed rubas closed 1 year ago
This should be helpful (consider aliasing Phoenix.Router.Route). Using apply
silences the warning.
def exprs(route, env) do
if Kernel.function_exported?(Phoenix.Router.Route, :exprs, 2) do
forwards = env.module |> Module.get_attribute(:phoenix_forwards)
apply(Phoenix.Router.Route, :exprs, [route, forwards])
else
apply(Phoenix.Router.Route, :exprs, [route])
end
end
@BartOtten thanks very much. I know I am way behind in getting this lib up-to-date. This will definitely help.
Ah, turns out I'd already made that change. I've done all the hard work on verified routes too - except the actual path translation which I just haven't prioritised. I will get this finished up in the next few days.
@kipcole9 first of all thanks for your hard work generally for cldr
, given Phoenix 1.7 is already out is there any chance we can publish a release to get the fix? Is there anything missing or we can help with to get this released?
routes_with_exprs = Enum.map(routes, &{&1, Phoenix.Router.Route.exprs(&1)})
This line changed in Phoenix.
https://github.com/phoenixframework/phoenix/blob/b3592c38a93bbb61dbf29d1c11245f350500797c/lib/phoenix/router.ex#L493