order query on time
This commit is contained in:
parent
670d748d40
commit
bd2c986604
2 changed files with 2 additions and 1 deletions
|
@ -30,7 +30,7 @@ class DataTable
|
||||||
end
|
end
|
||||||
|
|
||||||
def query
|
def query
|
||||||
q = @transactions.query
|
q = @transactions.query.order(@table[:time].desc)
|
||||||
q.where(predicate) if predicate
|
q.where(predicate) if predicate
|
||||||
q
|
q
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,7 @@ class TransactionsQuery
|
||||||
def query
|
def query
|
||||||
Arel::SelectManager.new(ActiveRecord::Base)
|
Arel::SelectManager.new(ActiveRecord::Base)
|
||||||
.from(arel)
|
.from(arel)
|
||||||
|
.order(@arel_table[:time].desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def arel
|
def arel
|
||||||
|
|
Loading…
Reference in a new issue