Fix empty hash issue #2962

This commit is contained in:
Martin Lensment 2015-09-24 11:55:18 +03:00 committed by Rene Vahtel
parent d9c2b992d2
commit b448313850
2 changed files with 4 additions and 1 deletions

View file

@ -3,6 +3,7 @@ class ReservedDomain < ActiveRecord::Base
before_save :fill_empty_passwords
def fill_empty_passwords
return unless names
names.each { |k, v| names[k] = SecureRandom.hex if v.blank? }
end