Skip to content

Commit

Permalink
Merge pull request #30 from woylie/update-meta
Browse files Browse the repository at this point in the history
Update meta
  • Loading branch information
woylie authored Jun 17, 2020
2 parents 57bfa90 + 556ba95 commit ecb61ea
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{"lib/flop/schema.ex:75:no_return Function filterable/1 has no local return."},
{"lib/flop/schema.ex:84:no_return Function sortable/1 has no local return."},
{"lib/flop/schema.ex:93:no_return Function default_limit/1 has no local return."},
{"lib/flop/schema.ex:102:no_return Function max_limit/1 has no local return."}
~r/lib\/flop\/schema\.ex.*no_return Function filterable\/1 has no local return\./,
~r/lib\/flop\/schema\.ex.*no_return Function sortable\/1 has no local return\./,
~r/lib\/flop\/schema\.ex.*no_return Function default_limit\/1 has no local return\./,
~r/lib\/flop\/schema\.ex.*no_return Function max_limit\/1 has no local return\./
]
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## [0.6.1] - 2020-06-17

## Changed

- Add Flop to Meta struct.

### Fixed

- Type `Flop.Filter.op` didn't include all operators.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add `flop` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:flop, "~> 0.6.0"}
{:flop, "~> 0.6.1"}
]
end
```
Expand Down
4 changes: 3 additions & 1 deletion lib/flop.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ defmodule Flop do
- `filters`: List of filters, see `t:Flop.Filter.t/0`.
"""
@type t :: %__MODULE__{
filters: [Filter.t() | nil],
filters: [Filter.t()] | nil,
limit: pos_integer | nil,
offset: non_neg_integer | nil,
order_by: [atom | String.t()] | nil,
Expand Down Expand Up @@ -257,6 +257,7 @@ defmodule Flop do
%Flop.Meta{
current_offset: 0,
current_page: 1,
flop: %Flop{limit: 10},
has_next_page?: false,
has_previous_page?: false,
next_offset: nil,
Expand Down Expand Up @@ -302,6 +303,7 @@ defmodule Flop do
%Meta{
current_offset: current_offset,
current_page: current_page,
flop: flop,
has_next_page?: has_next_page?,
has_previous_page?: has_previous_page?,
next_offset: next_offset,
Expand Down
3 changes: 3 additions & 0 deletions lib/flop/meta.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ defmodule Flop.Meta do
@type t :: %__MODULE__{
current_offset: non_neg_integer,
current_page: pos_integer,
flop: Flop.t(),
has_next_page?: boolean,
has_previous_page?: boolean,
next_offset: non_neg_integer | nil,
Expand All @@ -23,6 +24,7 @@ defmodule Flop.Meta do
@enforce_keys [
:current_offset,
:current_page,
:flop,
:has_next_page?,
:has_previous_page?,
:next_offset,
Expand All @@ -37,6 +39,7 @@ defmodule Flop.Meta do
defstruct [
:current_offset,
:current_page,
:flop,
:has_next_page?,
:has_previous_page?,
:next_offset,
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Flop.MixProject do
def project do
[
app: :flop,
version: "0.6.0",
version: "0.6.1",
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
Expand Down
3 changes: 3 additions & 0 deletions test/flop_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ defmodule FlopTest do
assert Flop.meta(Pet, flop) == %Meta{
current_offset: 4,
current_page: 3,
flop: flop,
has_next_page?: true,
has_previous_page?: true,
next_offset: 6,
Expand All @@ -399,6 +400,7 @@ defmodule FlopTest do
assert Flop.meta(Pet, flop) == %Meta{
current_offset: 4,
current_page: 3,
flop: flop,
has_next_page?: true,
has_previous_page?: true,
next_offset: 6,
Expand All @@ -420,6 +422,7 @@ defmodule FlopTest do
assert Flop.meta(Pet, flop) == %Meta{
current_offset: 0,
current_page: 1,
flop: flop,
has_next_page?: false,
has_previous_page?: false,
next_offset: nil,
Expand Down

0 comments on commit ecb61ea

Please sign in to comment.