From 3e5939ae05700bdeef4c098a6eabb8655d3b677f Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Mon, 20 Jun 2022 14:00:20 +0100 Subject: [PATCH] All is redundant --- app/models/form/setup/questions/created_by_id.rb | 2 +- app/models/form/setup/questions/owning_organisation_id.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/form/setup/questions/created_by_id.rb b/app/models/form/setup/questions/created_by_id.rb index a6e12f666..af4493542 100644 --- a/app/models/form/setup/questions/created_by_id.rb +++ b/app/models/form/setup/questions/created_by_id.rb @@ -14,7 +14,7 @@ class Form::Setup::Questions::CreatedById < ::Form::Question answer_opts = { "" => "Select an option" } return answer_opts unless ActiveRecord::Base.connected? - User.select(:id, :name).all.each_with_object(answer_opts) do |user, hsh| + User.select(:id, :name).each_with_object(answer_opts) do |user, hsh| hsh[user.id] = user.name hsh end diff --git a/app/models/form/setup/questions/owning_organisation_id.rb b/app/models/form/setup/questions/owning_organisation_id.rb index 8ddebc0da..3ce620681 100644 --- a/app/models/form/setup/questions/owning_organisation_id.rb +++ b/app/models/form/setup/questions/owning_organisation_id.rb @@ -14,7 +14,7 @@ class Form::Setup::Questions::OwningOrganisationId < ::Form::Question answer_opts = { "" => "Select an option" } return answer_opts unless ActiveRecord::Base.connected? - Organisation.select(:id, :name).all.each_with_object(answer_opts) do |organisation, hsh| + Organisation.select(:id, :name).each_with_object(answer_opts) do |organisation, hsh| hsh[organisation.id] = organisation.name hsh end