Skip to content

Commit

Permalink
order query on time
Browse files Browse the repository at this point in the history
  • Loading branch information
iasoon committed Sep 11, 2015
1 parent 670d748 commit bd2c986
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/concerns/data_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def paginated_query
end

def query
q = @transactions.query
q = @transactions.query.order(@table[:time].desc)
q.where(predicate) if predicate
q
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/transactions_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def initialize user
def query
Arel::SelectManager.new(ActiveRecord::Base)
.from(arel)
.order(@arel_table[:time].desc)
end

def arel
Expand Down

0 comments on commit bd2c986

Please sign in to comment.