diff --git a/app/controllers/api/v2/transactions_controller.rb b/app/controllers/api/v2/transactions_controller.rb index 34cbd1b..11ce4b6 100644 --- a/app/controllers/api/v2/transactions_controller.rb +++ b/app/controllers/api/v2/transactions_controller.rb @@ -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)