Snippets

Deepak Kumar Update intiator bank for missing records

Created by Deepak Kumar
1
2
3
4
5
6
7
8
TransactionLogs.where(:initiator_bank.in => [nil, '']).no_timeout.each_with_index do |txn|
  if txn.initiator_bank.blank?
    if (txn.transaction_uuid[-6] == "7") || (txn.transaction_uuid[-6] == "5")
      txn.update_attribute(:initiator_bank, 'HDFC') 
      puts "Index #{index + 1}"
    end
  end
end

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.