Fix contact code prefix on transfer #2595

This commit is contained in:
Martin Lensment 2015-06-03 12:13:16 +03:00
parent 2132489026
commit a7def0b7ae
2 changed files with 3 additions and 2 deletions

View file

@ -148,10 +148,10 @@ class Contact < ActiveRecord::Base
end
# rubocop:enable Metrics/CyclomaticComplexity
# used only for contact trasphere
# used only for contact transfer
def generate_new_code!
return nil if registrar.blank?
registrar.reload # for contact transfere
registrar.reload # for contact transfer
self[:code] = "#{registrar.code}:#{SecureRandom.hex(4)}".upcase
end