Przeglądaj źródła

Birth date not required in import

Maarten van den Berg 7 lat temu
rodzic
commit
279a0e2d5f
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      app/models/person.rb

+ 1 - 1
app/models/person.rb

@@ -81,7 +81,7 @@ class Person < ApplicationRecord
81 81
         p.infix       = row['infix']
82 82
         p.last_name   = row['last_name']
83 83
         p.email       = row['email']
84
-        p.birth_date  = Date.strptime(row['birth_date'])
84
+        p.birth_date  = Date.strptime(row['birth_date']) unless row['birth_date'].blank?
85 85
         p.save!
86 86
       end
87 87
       result << p