From 71a5380bcb263f21dd00a771867e8c714c705ef0 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 4 Jul 2023 18:04:47 +0300 Subject: [PATCH] fix: updatable row inputs --- app/controllers/avo/base_controller.rb | 2 +- lib/avo/concerns/has_fields.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/avo/base_controller.rb b/app/controllers/avo/base_controller.rb index f27488da21..83423e6962 100644 --- a/app/controllers/avo/base_controller.rb +++ b/app/controllers/avo/base_controller.rb @@ -253,7 +253,7 @@ def model_params end def permitted_params - @resource.get_field_definitions.select(&:updatable).map(&:to_permitted_param).concat extra_params + @resource.get_field_definitions.select(&:updatable).map(&:to_permitted_param).concat(extra_params).uniq end def extra_params diff --git a/lib/avo/concerns/has_fields.rb b/lib/avo/concerns/has_fields.rb index c56d2549be..9ebe43b014 100644 --- a/lib/avo/concerns/has_fields.rb +++ b/lib/avo/concerns/has_fields.rb @@ -98,6 +98,10 @@ def fields(only_root: false) if item.is_field? fields << item end + + if item.is_row? + fields << extract_fields_from_items(tab) + end end fields.flatten @@ -117,7 +121,7 @@ def extract_fields_from_items(thing) thing.items.each do |item| if item.is_field? fields << item - elsif item.is_panel? + elsif item.is_panel? || item.is_row? fields << extract_fields_from_items(item) end end