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
You can clone a snippet to your computer for local editing. Learn more.