Skip to content

Commit

Permalink
Fix ordering of FilterView.find_param for :select
Browse files Browse the repository at this point in the history
Since the order of the options passed in to the function decide which
value is default, and the "string" input field defaults to "contains",
then the order of the `~w(equals contains)` options passed into
`do_find_param` needs to be switched to `~w(contains equals)`.

Alternatively, if the switch to `~w(equals contains)` was intentional,
the vale passed into `do_find_param` for `:string` should be `equals`
instead of `contains`.
  • Loading branch information
Joseph DelCioppio authored and cpjolicoeur committed Nov 1, 2021
1 parent 63445ee commit dde286c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/torch/views/filter_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ defmodule Torch.FilterView do
end

defp find_param(params, field, :select) do
do_find_param(params, field, ~w(equals contains))
do_find_param(params, field, ~w(contains equals))
end

defp find_param(params, field, :date_select) do
Expand Down

0 comments on commit dde286c

Please sign in to comment.