Skip to content

Commit

Permalink
Verify ref_number_from_description return correct match
Browse files Browse the repository at this point in the history
  • Loading branch information
karlerikounapuu committed Sep 10, 2020
1 parent 166ff44 commit a05105b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/bank_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ def parsed_ref_number

def ref_number_from_description
(Billing::ReferenceNo::MULTI_REGEXP.match(description) || []).captures.each do |match|
break match if match.length == 7 || Billing::ReferenceNo.valid?(match)
break match if match.length == 7
if Billing::ReferenceNo.valid?(match) && Registrar.find_by(reference_no: match).any?
break match
end
end
end
end

0 comments on commit a05105b

Please sign in to comment.