diff --git a/app/controllers/synced_transactions_controller.rb b/app/controllers/synced_transactions_controller.rb index a888354..817cc2d 100644 --- a/app/controllers/synced_transactions_controller.rb +++ b/app/controllers/synced_transactions_controller.rb @@ -5,9 +5,11 @@ def index sort = params[:sort].presence || "event_time" sort_type = params[:sort_type].presence || "desc" @symbol = params[:search] + @source = params[:tx_source] txs = SyncedTransaction.where(user_id: nil) @total_symbols = txs.pluck(:origin_symbol).uniq txs = txs.where(origin_symbol: @symbol) if @symbol.present? + txs = txs.where(source: @source) if @source.present? txs = txs.available if @flag parts = txs.partition {|h| h.send("#{sort}").nil? || h.send("#{sort}") == 'N/A'} @txs = parts.last.sort_by{|h| h.send("#{sort}")} + parts.first diff --git a/app/views/synced_transactions/index.html.erb b/app/views/synced_transactions/index.html.erb index 4741a08..a7ec4e9 100644 --- a/app/views/synced_transactions/index.html.erb +++ b/app/views/synced_transactions/index.html.erb @@ -6,9 +6,12 @@