undefined function: AppName.Repo.paginate/2
Closed this issue · 2 comments
zaidakram commented
My Application's Repo looks like this
defmodule AppName.Repo do
use Ecto.Repo, otp_app: :app_name
use Scrivener, page_size: 20
end
My index action looks like this...
def index(conn, params) do
words = from(w in Word, order_by: [asc: :abc_id], preload: [:languages])
|> Repo.paginate(params)
render(conn, "index.json",
%{
words: words.entries,
current_page: words.page_number,
total_pages: words.total_pages,
per_page: words.page_size
}
)
end
Versions of other notable deps in mix file.
scrivener 1.0.0
phoenix 1.0.2
phoenix_ecto 1.2.0
ecto 1.0.3
P.S: Scrivener.paginate/2 works with %Scrivener.Config.
drewolson commented
Hm, I'm not sure why you'd be seeing this. I have an example application using Scrivener with all the newest dependencies here. Perhaps you could take a look and see if you're doing something incorrectly?
zaidakram commented
And I've no idea why it has started working now. 😠