Improved result by using sql order.

This commit is contained in:
Martin Edenhofer 2016-12-16 13:27:16 +01:00
parent a7cdb592b7
commit 6b6a0a05e5

View file

@ -94,7 +94,7 @@ returns
'tickets.close_at IS NOT NULL AND tickets.close_at >= ? AND tickets.close_at < ?',
params[:range_start],
params[:range_end],
).where(query, *bind_params).joins(tables)
).where(query, *bind_params).joins(tables).order(close_at: :asc)
count = 0
assets = {}
ticket_ids = []