From 509117e07eb8f863eee8722f3a8b4a0639698d97 Mon Sep 17 00:00:00 2001 From: Daniel Orner Date: Sun, 15 Dec 2024 10:14:13 -0500 Subject: [PATCH 1/3] Fix default location PR --- app/views/donations/_donation_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/donations/_donation_form.html.erb b/app/views/donations/_donation_form.html.erb index fd0a0ba6e3..99abdadd5d 100644 --- a/app/views/donations/_donation_form.html.erb +++ b/app/views/donations/_donation_form.html.erb @@ -39,7 +39,7 @@
<%= 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", @@ -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: default_location(@donation), include_blank: true, wrapper: :input_group %>
From af47b5506248f42ddb9b41cc7ee87d2ae3bfbe42 Mon Sep 17 00:00:00 2001 From: Daniel Orner Date: Sun, 15 Dec 2024 10:18:36 -0500 Subject: [PATCH 2/3] fixy --- app/views/donations/_donation_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/donations/_donation_form.html.erb b/app/views/donations/_donation_form.html.erb index 99abdadd5d..977ef7319c 100644 --- a/app/views/donations/_donation_form.html.erb +++ b/app/views/donations/_donation_form.html.erb @@ -67,7 +67,7 @@ collection: @storage_locations, label: "Storage Location", error: "Where is it being stored?", - selected: default_location(@donation), + selected: donation_form.storage_location&.id || default_location(@donation), include_blank: true, wrapper: :input_group %> From a201cb7020852b60167d305ae5c743610dc1a76b Mon Sep 17 00:00:00 2001 From: Daniel Orner Date: Sun, 15 Dec 2024 10:26:42 -0500 Subject: [PATCH 3/3] fix spec --- spec/requests/donations_requests_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/donations_requests_spec.rb b/spec/requests/donations_requests_spec.rb index 60c3a1ae90..cfaea749c3 100644 --- a/spec/requests/donations_requests_spec.rb +++ b/spec/requests/donations_requests_spec.rb @@ -268,7 +268,7 @@ expect(response.body).to include("
  • \n Editing #{original_source}") expect(response.body).to include("") expect(response.body).to include("") - expect(response.body).to include("") + expect(response.body).to include("") expect(response.body).to include("") expect(response.body).to include(edited_comment) expect(response.body).to include("value=\"#{edited_money}\" type=\"text\" name=\"donation[money_raised_in_dollars]")