Skip to content

Commit

Permalink
Fix finding comment field when avo pro is missing
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
  • Loading branch information
segiddins committed Sep 24, 2024
1 parent 412de28 commit 84efb82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/avo/resources/concerns/avo_auditable_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ def fetch_fields
module HasItemsIncludeComment
def visible_items
items = super
return items unless view.form? && items.none? { |item| item.id == :comment }

comment = self.items.find { |item| item.id == :comment }
return items unless comment
items << comment
if view.form?
comment = self.items.find { |item| item.respond_to?(:id) && item.id == :comment }
items << comment if comment
end
items
end
end
end

0 comments on commit 84efb82

Please sign in to comment.