Improved join.

This commit is contained in:
Martin Edenhofer 2016-12-14 03:27:08 +01:00
parent 5a3f8c1bb6
commit 1ffc19455a

View file

@ -166,7 +166,7 @@ returns
else
query_condition, bind_condition, tables = selector2sql(condition)
tickets_all = Ticket.select('DISTINCT(tickets.id), tickets.created_at')
.from("tickets#{tables}")
.joins(tables)
.where(access_condition)
.where(query_condition, *bind_condition)
.order('tickets.created_at DESC')