Skip to content

Commit

Permalink
Better expression
Browse files Browse the repository at this point in the history
Co-Authored-By: James Chen <james@ashchan.com>
  • Loading branch information
classicalliu and ashchan authored May 16, 2019
1 parent a20574e commit 37758f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v2/transactions_controller.rb
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ def index
# FIXME: should order by block_number and index desc, change block_number to integer
transactions = Transaction.ransack(options).result.order(updated_at: :desc)

if params[:page].nil? && (!params[:offset].nil? || !params[:limit].nil?)
if params[:page].nil? && (params[:offset].present? || params[:limit].present?)
offset = params[:offset] || 0
limit = params[:limit] || 10
transactions = transactions.offset(offset).limit(limit)

0 comments on commit 37758f9

Please sign in to comment.