flat-television-5571
04/07/2025, 10:56 AMnested feature and was getting `undefined method `klass for nil from this method def model
@model ||= @parent_model_class.reflections[@field.name.downcase].klass
end, from avo-advanced (3.19.1) app/components/avo/advanced/nested/field_component.rb:29, I noticed that I was getting "purchase order items" from "@field.name.downcase" instead of purchase_order_items. I think this only works if we have model name without underscore.loud-jewelry-99127
04/07/2025, 10:56 AMloud-jewelry-99127
04/07/2025, 10:56 AMloud-jewelry-99127
04/07/2025, 10:57 AMflat-television-5571
04/07/2025, 10:58 AMloud-jewelry-99127
04/07/2025, 10:59 AMflat-television-5571
04/07/2025, 11:03 AMdef fields
field :id, as: :id
field :supplier, as: :belongs_to, searchable: true
field :order_date, as: :date, default: -> { Date.today }
field :purchase_order_items, as: :has_many, nested: true
end, and in my purchase order item resource => def fields
field :id, as: :id
field :purchase_order, as: :belongs_to
field :product_unit, as: :belongs_to,
can_create: false,
searchable: true
field :quantity, as: :number
field :product_unit_prices, as: :has_many, attach_scope: -> { query }, hide_on: [:index], name: "Prices"
end.loud-jewelry-99127
04/07/2025, 11:05 AMflat-television-5571
04/07/2025, 11:05 AMfield :purchase_order_items, as: :has_many, nested: true, name: 'purchase_order_items'loud-jewelry-99127
04/07/2025, 11:06 AMloud-jewelry-99127
04/07/2025, 11:06 AMflat-television-5571
04/07/2025, 11:07 AMloud-jewelry-99127
04/07/2025, 11:42 AM3.19.2 could you please confirm?
Thank you!flat-television-5571
04/07/2025, 12:12 PMloud-jewelry-99127
04/07/2025, 12:13 PM