Merge branch 'setop-main-patch-92671' into 'main'

include ongoing events in search

Closes #729

See merge request framasoft/mobilizon!1171
This commit is contained in:
Thomas Citharel 2022-05-02 06:48:16 +00:00
commit 93805dca11

View file

@ -1287,7 +1287,12 @@ defmodule Mobilizon.Events do
if is_nil(begins_on) do
query
else
where(query, [q], q.begins_on >= ^begins_on)
where(
query,
[q],
(not is_nil(q.ends_on) and q.ends_on > ^begins_on) or
(is_nil(q.ends_on) and q.begins_on >= ^begins_on)
)
end
end