Skip to content

Commit

Permalink
BankTransaction: Find reference numbers with any length from description
Browse files Browse the repository at this point in the history
  • Loading branch information
karlerikounapuu committed Sep 9, 2020
1 parent 05ca909 commit d8ef342
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/bank_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def parsed_ref_number
end

def ref_number_from_description
match_data = /(\d{7})/.match(description)
match_data[0] if match_data.present?
Billing::ReferenceNo::REGEXP.match(description).each do |match|
return match if match.length == 7 || Registrar.where(reference_no: match).present?
end
end
end

0 comments on commit d8ef342

Please sign in to comment.