diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index 6a5ea875d..f82906129 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -128,8 +128,8 @@ private return {} unless params[:case_log] permitted = params.require(:case_log).permit(CaseLog.editable_fields) - permitted["owning_organisation"] = Organisation.find_by(permitted["owning_organisation"]) - permitted["managing_organisation"] = Organisation.find_by(permitted["managing_organisation"]) + owning_id = permitted["owning_organisation_id"] + permitted["owning_organisation"] = Organisation.find(owning_id) if owning_id permitted end diff --git a/app/models/form/setup/questions/created_by_id.rb b/app/models/form/setup/questions/created_by_id.rb index af4493542..f92c688f8 100644 --- a/app/models/form/setup/questions/created_by_id.rb +++ b/app/models/form/setup/questions/created_by_id.rb @@ -7,10 +7,9 @@ class Form::Setup::Questions::CreatedById < ::Form::Question @hint_text = "" @type = "select" @page = page - @answer_options = answer_options_values end - def answer_options_values + def answer_options answer_opts = { "" => "Select an option" } return answer_opts unless ActiveRecord::Base.connected? diff --git a/app/models/form/setup/questions/owning_organisation_id.rb b/app/models/form/setup/questions/owning_organisation_id.rb index 3ce620681..857ccaf68 100644 --- a/app/models/form/setup/questions/owning_organisation_id.rb +++ b/app/models/form/setup/questions/owning_organisation_id.rb @@ -7,10 +7,9 @@ class Form::Setup::Questions::OwningOrganisationId < ::Form::Question @hint_text = "" @type = "select" @page = page - @answer_options = answer_options_values end - def answer_options_values + def answer_options answer_opts = { "" => "Select an option" } return answer_opts unless ActiveRecord::Base.connected? diff --git a/app/views/organisations/logs.html.erb b/app/views/organisations/logs.html.erb index b4625d594..9d8e978dc 100644 --- a/app/views/organisations/logs.html.erb +++ b/app/views/organisations/logs.html.erb @@ -12,6 +12,10 @@