Skip to content

Commit

Permalink
fix: updatable row inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jul 4, 2023
1 parent 7a51a16 commit 71a5380
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/avo/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion lib/avo/concerns/has_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 71a5380

Please sign in to comment.