mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
BankTransaction: Find reference numbers with any length from description
This commit is contained in:
parent
05ca909741
commit
e61601fdd7
2 changed files with 4 additions and 2 deletions
|
@ -121,7 +121,8 @@ class BankTransaction < ApplicationRecord
|
|||
end
|
||||
|
||||
def ref_number_from_description
|
||||
match_data = /(\d{7})/.match(description)
|
||||
match_data[0] if match_data.present?
|
||||
(Billing::ReferenceNo::MULTI_REGEXP.match(description) || []).captures.each do |match|
|
||||
break match if match.length == 7 || Registrar.where(reference_no: match).present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue