Browse Source

Only select the fields we actually need

pull/674/head
baarkerlounger 3 years ago
parent
commit
bb5500b88c
  1. 2
      app/models/form/setup/questions/created_by_id.rb
  2. 2
      app/models/form/setup/questions/owning_organisation_id.rb

2
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

2
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

Loading…
Cancel
Save