Skip to content
Snippets Groups Projects
Commit e83c165f authored by Simon Hürlimann's avatar Simon Hürlimann
Browse files

Fix ESR record duplicate detection to not detect itself as a candidate.

parent a4c928c4
Branches hozr
No related tags found
No related merge requests found
......@@ -181,7 +181,10 @@ class EsrRecord < ActiveRecord::Base
# Tries to find a record this would duplicate
def duplicate_of
EsrRecord.find(:first, :conditions => {:reference => reference, :bank_pc_id => bank_pc_id, :amount => amount, :payment_date => payment_date, :transaction_date => transaction_date})
candidates = EsrRecord.find(:all, :conditions => {:reference => reference, :bank_pc_id => bank_pc_id, :amount => amount, :payment_date => payment_date, :transaction_date => transaction_date})
candidates = candidates.reject{ |candidate| candidate == self }
candidates.first
end
def create_esr_booking
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment