lib/avo/base_resource.rb in avo-2.49.0 vs lib/avo/base_resource.rb in avo-2.52.0

- old
+ new

@@ -112,11 +112,11 @@ ordering.dig(:actions) || {} end def get_record_associations(record) - record._reflections + record.class.reflections end def valid_association_name(record, association_name) get_record_associations(record).keys.find do |name| name == association_name @@ -380,10 +380,10 @@ .map do |field| value = field.value if field.type == "belongs_to" - reflection = @model._reflections[@params[:via_relation]] + reflection = @model.class.reflections[@params[:via_relation]] if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params[:via_relation_class]) # set the value to the actual record via_resource = ::Avo::App.get_resource_by_model_name(@params[:via_relation_class]) value = via_resource.find_record(@params[:via_resource_id])