Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default config not loaded #60

Closed
InteNs opened this issue Jan 23, 2018 · 2 comments
Closed

default config not loaded #60

InteNs opened this issue Jan 23, 2018 · 2 comments

Comments

@InteNs
Copy link

InteNs commented Jan 23, 2018

hey i get the following error:

(RuntimeError) Expected key `repo` in `opts`, got []

heres my config:

config :plonquo_api, Rummage.Ecto,
  repo: PlonquoApi.Repo,
  per_page: 300

and the controller code:

  def index(conn, %{"per_page" => per, "page" => page}) do
    {query, _rummage} = Rummage.Ecto.rummage(Activity, %{paginate: %{per_page: per, page: page}})

    data = query
           |> Activity.preload
           |> Repo.all
    render conn, "index.json-api", data: data
  end
@thebugcatcher
Copy link
Contributor

Hi @InteNs. rummage_ecto has changed to not using configuration for Rummage.Ecto.rummage/2 call.

If you have used Rummage.Ecto in Activity module, you can call Activity.rummage(%{paginate: %{}):

defmodule Activity do
  use Rummage.Ecto

  # more code here
end

# In controller:

Activity.rummage(%{paginate: ...})

@InteNs
Copy link
Author

InteNs commented Jan 24, 2018

@aditya7iyengar I'm assuming this only works in >= 1.3.0?

on v1.2 i'm getting:
== Compilation error in file lib/plonquo_api/schemas/activity.ex == ** (UndefinedFunctionError) function Rummage.Ecto.__using__/1 is undefined or private

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants