Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Mar 11, 2025
1 parent 9b7970f commit 654d798
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/avo/base_application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ def detect_fields
end

def set_related_resource
# Find the field from the parent resource
association_field = find_association_field(resource: @resource, association: params[:related_name])

# Find the field from the parent resource
# Find the resource from the related field
related_resource = association_field.hydrate(record: @record).resource_class(params)

raise Avo::MissingResourceError.new(related_resource_name, association_field) if related_resource.nil?
Expand Down

0 comments on commit 654d798

Please sign in to comment.