Skip to content

Commit

Permalink
Merge pull request #4855 from rubyforgood/fix-default-location
Browse files Browse the repository at this point in the history
Fix default location PR
  • Loading branch information
awwaiid authored Dec 15, 2024
2 parents 49c9308 + a201cb7 commit 36f4fe8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/views/donations/_donation_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="col-xs-8 col-md-6 col-lg-3">
<%= f.association :product_drive_participant,
collection: @product_drive_participants,
selected: default_location(@donation),
selected: donation_form.product_drive_participant_id,
include_blank: true,
label_method: lambda { |x| "#{x.try(:business_name) }" },
label: "Product Drive Participant",
Expand Down Expand Up @@ -67,7 +67,7 @@
collection: @storage_locations,
label: "Storage Location",
error: "Where is it being stored?",
selected: donation_form.storage_location&.id || current_organization.intake_location,
selected: donation_form.storage_location&.id || default_location(@donation),
include_blank: true,
wrapper: :input_group %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/donations_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
expect(response.body).to include("<li class=\"breadcrumb-item\">\n <a href=\"#\">Editing #{original_source}")
expect(response.body).to include("<option selected=\"selected\" value=\"#{edited_source}\">#{edited_source}</option>")
expect(response.body).to include("<option selected=\"selected\" value=\"#{edited_source_drive.id}\">#{edited_source_drive_name}</option>")
expect(response.body).to include("<option value=\"#{edited_source_drive_participant.id}\">#{edited_source_drive_participant_business_name}</option>")
expect(response.body).to include("<option selected=\"selected\" value=\"#{edited_source_drive_participant.id}\">#{edited_source_drive_participant_business_name}</option>")
expect(response.body).to include("<option selected=\"selected\" value=\"#{edited_storage_location.id}\">#{edited_storage_location_name}</option>")
expect(response.body).to include(edited_comment)
expect(response.body).to include("value=\"#{edited_money}\" type=\"text\" name=\"donation[money_raised_in_dollars]")
Expand Down

0 comments on commit 36f4fe8

Please sign in to comment.