Skip to content

Commit

Permalink
fix: Speaker birthplace not persisted (#978)
Browse files Browse the repository at this point in the history
Fixes #953: When creating or updating a Speaker, the birthplace is not persisted
when changed.

This fix ensures that birthplace, when selected, is persisted to the db.

This also updates the dropdown to allow a blank value (as birthplace is
optional).

Co-authored-by: Laura Mosher <lauramosher@users.noreply.github.com>
  • Loading branch information
lauramosher and lauramosher committed Oct 27, 2023
1 parent 7b46bae commit 17ae2db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rails/app/controllers/dashboard/speakers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def speaker_params
:photo,
:speaker_community,
:birthdate,
:birthplace,
:birthplace_id,
story_ids: []
)
end
Expand Down
2 changes: 1 addition & 1 deletion rails/app/views/dashboard/speakers/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<%= f.date_field :birthdate %>
<%= f.label :birthplace_id %>
<%= f.collection_select :birthplace_id, current_community.places, :id, :name %>
<%= f.collection_select :birthplace_id, current_community.places, :id, :name, include_blank: true %>
<%= f.label :story_ids %>
<div class="checklist">
Expand Down

0 comments on commit 17ae2db

Please sign in to comment.