From 794f3f0c7c916522840b7957e9de71e6537341d2 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 4 Mar 2022 12:58:24 +0000 Subject: [PATCH] Set providertype before save (#334) --- app/admin/organisations.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/organisations.rb b/app/admin/organisations.rb index 3b106c1f0..129aa8ff9 100644 --- a/app/admin/organisations.rb +++ b/app/admin/organisations.rb @@ -17,7 +17,7 @@ ActiveAdmin.register Organisation do selectable_column id_column column :name - column "Org type", :providertype + column "Org type", :provider_type column "Address Line 1", :address_line1 column "Address Line 2", :address_line2 column :postcode @@ -28,4 +28,8 @@ ActiveAdmin.register Organisation do column :managing_agents actions end + + before_save do |org| + org.provider_type = params[:organisation][:provider_type] + end end