Skip to content

Commit

Permalink
Merge pull request #56 from aditya7iyengar/1.3.0-rc
Browse files Browse the repository at this point in the history
Rummage 1.3.0-rc
  • Loading branch information
Adi Iyengar committed Jan 9, 2018
2 parents a10a3da + c99191a commit 79aca21
Show file tree
Hide file tree
Showing 30 changed files with 2,541 additions and 1,224 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ erl_crash.dump

# Inch CI
/docs

*.sqlite3
*.sqlite3-*
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
elixir 1.4.5
erlang 20.1
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: elixir
elixir:
- 1.3.4
- 1.4.5
- 1.5.2
otp_release:
- 19.0
- 20.1
sudo: false
env:
- MIX_ENV=test ECTO_PGSQL_USER=postgres ECTO_PGSQL_PASSWORD=
script:
- mix test
after_script:
- mix hex.audit
- mix coveralls.travis
- mix credo
- mix deps.get --only docs
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Versions CHANGELOG

## Version: 1.3.0

### TODO:

- Bring back `__using__`
- Make default hooks more generalized
- Add NoPrimaryKey pagination hook or add a generalized version of current hook
- Change the way configurations are done
- Update Documentation

### DONE:


## Version: 1.2.0

- Faster Pagination Hooks

## Version: 1.1.0

### Changes to Rummage as whole:
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ This package is [available in Hex](https://hexdocs.pm/rummage_ecto/), and can be
```elixir
config :rummage_ecto,
Rummage.Ecto,
default_search: MyApp.SearchModule
search: MyApp.SearchModule
```

- For configuring a repo:

```elixir
config :rummage_ecto,
Rummage.Ecto,
default_repo: MyApp.Repo # This can be overridden per model basis, if need be.
repo: MyApp.Repo # This can be overridden per model basis, if need be.
```

- Other config options are: `default_repo`, `default_sort`, `default_paginate`, `default_per_page`
- Other config options are: `repo`, `sort`, `paginate`, `per_page`

- `Rummage.Ecto` can be configured globally with a `default_per_page` value (which can be overridden for a model).
- `Rummage.Ecto` can be configured globally with a `per_page` value (which can be overridden for a model).
If you want to set different `per_page` for different the models, add it to `model.exs` file while using `Rummage.Ecto`
as shown in the [Advanced Usage Section](#advanced-usage).

Expand All @@ -99,8 +99,8 @@ Below are the ways `Rummage.Ecto` can be used:

```elixir
config :rummage_ecto, Rummage.Ecto,
default_repo: MyApp.Repo,
default_per_page: 10
repo: MyApp.Repo,
per_page: 10
```

- And you should be able to use `Rummage.Ecto` with any `Ecto` model.
Expand All @@ -112,9 +112,9 @@ Below are the ways `Rummage.Ecto` can be used:

```elixir
config :rummage_ecto, Rummage.Ecto,
default_repo: MyApp.Repo,
default_search: MyApp.SearchModule,
default_paginate: MyApp.PaginateModule
repo: MyApp.Repo,
search: MyApp.SearchModule,
paginate: MyApp.PaginateModule
```

- When using `Rummage.Ecto` with an app that has multiple `Repo`s, or when there's a need to configure `Repo` per model basis, it can be passed along with
Expand Down
12 changes: 4 additions & 8 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ use Mix.Config
config :logger, :console,
level: :error

config :rummage_ecto, Rummage.Ecto,[
default_repo: Rummage.Ecto.Repo,
default_per_page: 2,
]
config :rummage_ecto, Rummage.Ecto,
repo: Rummage.Ecto.Repo,
per_page: 2

config :rummage_ecto, ecto_repos: [Rummage.Ecto.Repo]

config :rummage_ecto, Rummage.Ecto.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("ECTO_PGSQL_USER"),
password: System.get_env("ECTO_PGSQL_PASSWORD"),
database: "rummage_ecto_test",
hostname: "localhost",
database: "rummage_ecto_test.sqlite3",
pool: Ecto.Adapters.SQL.Sandbox
1 change: 1 addition & 0 deletions help/nomenclature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Nomenclature
1 change: 1 addition & 0 deletions help/walkthrough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Walkthrough
Loading

0 comments on commit 79aca21

Please sign in to comment.