diff --git a/app/models/form/setup/questions/created_by_id.rb b/app/models/form/setup/questions/created_by_id.rb index 1342ef34f..a6e12f666 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.all.each_with_object(answer_opts) do |user, hsh| + User.select(:id, :name).all.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 c26aa6d16..8ddebc0da 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.all.each_with_object(answer_opts) do |organisation, hsh| + Organisation.select(:id, :name).all.each_with_object(answer_opts) do |organisation, hsh| hsh[organisation.id] = organisation.name hsh end