Skip to content

Commit 5a6ed87

Browse files
committed
Add more docs:
- The process of improving docs keeps going on
1 parent 94bd766 commit 5a6ed87

File tree

7 files changed

+33
-26
lines changed

7 files changed

+33
-26
lines changed

CHANGELOG.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Rummage.Ecto Versions CHANGELOG
1+
# Versions CHANGELOG
22

33
## Version: 1.0.0
44

@@ -17,12 +17,26 @@
1717

1818
### Change in `rummage` struct syntaxes:
1919
- `search` key:
20-
- Earlier: rummage = %{"search" => %{"field_1" => "field_!"}}
21-
- Now: rummage = %{"search" => %{"field_1" => {["association_name"], "like", "field_!"}}}
20+
- Earlier:
21+
```elixir
22+
rummage = %{"search" => %{"field_1" => "field_!"}}
23+
```
24+
25+
- Now:
26+
```elixir
27+
rummage = %{"search" => %{"field_1" => %{"assoc" => ["assoc_1", "assoc_2"], "search_type" => "like", "search_term" => "field_!"}}
28+
```
2229

2330
- `sort` key:
24-
- Earlier: %{"sort" => "field_1.asc"}
25-
- Now: %{"sort" => {["association_name", "association_name"], "field_1.asc.ci"}}
31+
- Earlier:
32+
```elixir
33+
rummage = %{"sort" => "field_1.asc"}
34+
```
35+
36+
- Now:
37+
```elixir
38+
rummage = %{"sort" => %{"assoc" => ["assoc_1", "assoc_2"], "field" => "field_1.asc"}}
39+
```
2640

2741
- `paginate` key: NO CHANGES
2842

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ to it. You can check `Rummage.Phoenix` out by clicking [here](https://github.com
1313

1414
**Please refer for [CHANGELOG](CHANGELOG.md) for version specific changes**
1515

16-
`Rummage.Ecto` is a framework that can be used to alter `Ecto` queries with Search, Sort and Paginate operations.
16+
`Rummage.Ecto` is a light weight, but powerful framework that can be used to alter `Ecto` queries with Search, Sort and Paginate operations.
1717

1818
It accomplishes the above operations by using `Hooks`, which are modules that implement `Rumamge.Ecto.Hook` behavior.
1919
Each operation: `Search`, `Sort` and `Paginate` have their hooks defined in `Rummage`. By doing this, `Rummage` is completely

doc_readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ to it. You can check `Rummage.Phoenix` out by clicking [here](https://github.com
55

66
**Please refer for `CHANGELOG` for version specific changes**
77

8-
`Rummage.Ecto` is a framework that can be used to alter `Ecto` queries with Search, Sort and Paginate operations.
8+
`Rummage.Ecto` is a light weight, but powerful framework that can be used to alter `Ecto` queries with Search, Sort and Paginate operations.
99

1010
It accomplishes the above operations by using `Hooks`, which are modules that implement `Rumamge.Ecto.Hook` behavior.
1111
Each operation: `Search`, `Sort` and `Paginate` have their hooks defined in `Rummage`. By doing this, `Rummage` is completely

lib/rummage_ecto.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Rummage.Ecto do
22
@moduledoc ~S"""
3-
Rummage.Ecto is a simple framework that can be used to alter Ecto queries with
4-
Search, Sort and Paginate operations.
3+
Rummage.Ecto is a light weight, but powerful framework that can be used to alter Ecto
4+
queries with Search, Sort and Paginate operations.
55
66
It accomplishes the above operations by using `Hooks`, which are modules that
77
implement `Rumamge.Ecto.Hook` behavior. Each operation: Search, Sort and Paginate

lib/rummage_ecto/hooks/paginate.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ defmodule Rummage.Ecto.Hooks.Paginate do
2323
default_paginate: CustomHook
2424
```
2525
26-
The `CustomHook` must implement `@behaviour Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
27-
`custom_hooks` that are shipped with elixir:
28-
29-
* `Rummage.Ecto.CustomHooks.SimpleSearch`
30-
* `Rummage.Ecto.CustomHooks.SimpleSort`
26+
The `CustomHook` must implement behaviour `Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
27+
`custom_hooks` that are shipped with elixir: `Rummage.Ecto.CustomHooks.SimpleSearch`, `Rummage.Ecto.CustomHooks.SimpleSort`
3128
"""
3229

3330
import Ecto.Query

lib/rummage_ecto/hooks/search.ex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ defmodule Rummage.Ecto.Hooks.Search do
1616
alias Rummage.Ecto.Hooks.Search
1717
1818
searched_queryable = Search.run(Parent, %{"search" => %{"field_1" => %{"assoc" => [], "search_type" => "like", "search_term" => "field_!"}}}
19+
1920
```
2021
2122
For a case-insensitive search:
@@ -29,6 +30,7 @@ defmodule Rummage.Ecto.Hooks.Search do
2930
alias Rummage.Ecto.Hooks.Search
3031
3132
searched_queryable = Search.run(Parent, %{"search" => %{"field_1" => %{"assoc" => [], "search_type" => "ilike", "search_term" => "field_!"}}}
33+
3234
```
3335
3436
There are many other `search_types`. Check out `Rummage.Ecto.Services.BuildSearchQuery`'s docs
@@ -54,11 +56,8 @@ defmodule Rummage.Ecto.Hooks.Search do
5456
default_search: CustomHook
5557
```
5658
57-
The `CustomHook` must implement `@behaviour Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
58-
`custom_hooks` that are shipped with elixir:
59-
60-
* `Rummage.Ecto.CustomHooks.SimpleSearch`
61-
* `Rummage.Ecto.CustomHooks.SimpleSort`
59+
The `CustomHook` must implement `behaviour `Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
60+
`custom_hooks` that are shipped with elixir: `Rummage.Ecto.CustomHooks.SimpleSearch`, `Rummage.Ecto.CustomHooks.SimpleSort`
6261
"""
6362

6463
import Ecto.Query

lib/rummage_ecto/hooks/sort.ex

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Rummage.Ecto.Hooks.Sort do
1212
```elixir
1313
alias Rummage.Ecto.Hooks.Sort
1414
15-
sorted_queryable = Sort.run(Parent, %{"sort" => %{"assoc" => [], "field" => "field_1.asc"}])
15+
sorted_queryable = Sort.run(Parent, %{"sort" => %{"assoc" => [], "field" => "field_1.asc"}})
1616
```
1717
1818
For a case-insensitive sort:
@@ -25,7 +25,7 @@ defmodule Rummage.Ecto.Hooks.Sort do
2525
```elixir
2626
alias Rummage.Ecto.Hooks.Sort
2727
28-
sorted_queryable = Sort.run(Parent, %{"sort" => %{"assoc" => [], "field" => "field_1.asc.ci"}])
28+
sorted_queryable = Sort.run(Parent, %{"sort" => %{"assoc" => [], "field" => "field_1.asc.ci"}})
2929
```
3030
3131
@@ -49,11 +49,8 @@ defmodule Rummage.Ecto.Hooks.Sort do
4949
default_sort: CustomHook
5050
```
5151
52-
The `CustomHook` must implement `@behaviour Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
53-
`custom_hooks` that are shipped with elixir:
54-
55-
* `Rummage.Ecto.CustomHooks.SimpleSearch`
56-
* `Rummage.Ecto.CustomHooks.SimpleSort`
52+
The `CustomHook` must implement behaviour `Rummage.Ecto.Hook`. For examples of `CustomHook`, check out some
53+
`custom_hooks` that are shipped with elixir: `Rummage.Ecto.CustomHooks.SimpleSearch`, `Rummage.Ecto.CustomHooks.SimpleSort`
5754
"""
5855

5956
import Ecto.Query

0 commit comments

Comments
 (0)