From 489aacf156d72d23eb1533151f60c9066159cd11 Mon Sep 17 00:00:00 2001 From: Jan Cernik <66427541+jancernik@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:43:11 -0300 Subject: [PATCH] DEV: Use the `only` option when returning groups as json (#296) --- app/controllers/discourse_data_explorer/query_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/discourse_data_explorer/query_controller.rb b/app/controllers/discourse_data_explorer/query_controller.rb index 2ecfc34..660ba75 100644 --- a/app/controllers/discourse_data_explorer/query_controller.rb +++ b/app/controllers/discourse_data_explorer/query_controller.rb @@ -44,7 +44,7 @@ module ::DiscourseDataExplorer end def groups - render json: Group.all.select(:id, :name), root: false + render json: Group.all.select(:id, :name).as_json(only: %i[id name]), root: false end def group_reports_index