Skip to content

Commit 3c6d944

Browse files
nbudinclaude
andcommitted
Default first_name/last_name to empty string in profile import
Exporters omit name fields from profiles when they are blank, so prof[:first_name] and prof[:last_name] can be nil. Passing nil directly to assign_form_response_attributes triggers a NOT NULL violation on the user_con_profiles table. .to_s converts nil to "" safely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent baf8ba5 commit 3c6d944

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/services/import_convention_data_service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ def import_user_con_profiles(convention, user_map)
283283

284284
def profile_form_response_attrs(prof)
285285
{
286-
first_name: prof[:first_name],
287-
last_name: prof[:last_name],
286+
first_name: prof[:first_name].to_s,
287+
last_name: prof[:last_name].to_s,
288288
nickname: prof[:nickname],
289289
bio: prof[:bio],
290290
show_nickname_in_bio: prof[:show_nickname_in_bio],

0 commit comments

Comments
 (0)