Ecto 3.0
nilsivanson opened this issue · 2 comments
Hello,
Ecto 3.0 seems to be coming along. However if I try to compile scrivener_ecto against the master branch of ecto we have an offending line causing compilation error. I am not sure if this is an issue with ecto or with scrivener_ecto. However I figured so far that someone else ought to run into this problem eventually.
https://github.com/drewolson/scrivener_ecto/blob/master/lib/scrivener/paginater/ecto/query.ex#L66
lib/scrivener/paginater/ecto/query.ex:66
|> select([x: source_index], struct(x, ^[field]))
== Compilation error in file lib/scrivener/paginater/ecto/query.ex ==
** (Ecto.Query.CompileError) unbound variable `x` in query. If you are attempting to interpolate a value, use ^var
expanding macro: Ecto.Query.select/3
lib/scrivener/paginater/ecto/query.ex:55: Scrivener.Paginater.Ecto.Query.prepare_select/1
(elixir) expanding macro: Kernel.|>/2
lib/scrivener/paginater/ecto/query.ex:55: Scrivener.Paginater.Ecto.Query.prepare_select/1
If you are not using group_by in your pagination query I think you should be fine just removing the lines like this as a temporary workaround
rsystem-se@f636d29
Hey! You just need to change the syntax around in order to make it build with Ecto 3.0. See my PR #60
Great!