Added registrar legacy migration and don't allow blank nor colon in code

This commit is contained in:
Priit Tark 2015-05-04 14:07:06 +03:00
parent 834d638423
commit 8f23ef510d
4 changed files with 89 additions and 2 deletions

View file

@ -138,6 +138,6 @@ class Registrar < ActiveRecord::Base
end
def code=(code)
self[:code] = code.upcase if new_record? && code.present?
self[:code] = code.gsub(/[ :]/, '').upcase if new_record? && code.present?
end
end