Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# encoding: UTF-8
# frozen_string_literal: true
class ConvertToLegacyBitcoinCashAddresses < ActiveRecord::Migration[4.2]
def change
return unless defined?(PaymentAddress)
return unless defined?(Currency)
return unless table_exists?(:payment_addresses)
return unless column_exists?(:payment_addresses, :address)
return unless column_exists?(:payment_addresses, :currency_id)
return unless column_exists?(:currencies, :id)
return unless column_exists?(:currencies, :code)
Currency.find_by_id(:bch).tap do |ccy|
break unless ccy
PaymentAddress.where(currency: ccy).find_each do |pa|
next if pa.address.blank?
pa.update_columns(address: CashAddr::Converter.to_legacy_address(pa.address))
end
end
end
end