lib/avo/fields/has_base_field.rb in avo-3.0.0.pre13 vs lib/avo/fields/has_base_field.rb in avo-3.0.0.pre14
- old
+ new
@@ -25,11 +25,11 @@
@discreet_pagination = args[:discreet_pagination] || false
@link_to_child_resource = args[:link_to_child_resource] || false
end
def field_resource
- resource || Avo::App.resources.get_resource_by_model_class(@record.class)
+ resource || Avo.resource_manager.get_resource_by_model_class(@record.class)
end
def turbo_frame
"#{self.class.name.demodulize.to_s.underscore}_#{display}_#{frame_id}"
end
@@ -55,14 +55,14 @@
nil
end
def target_resource
if @record._reflections[id.to_s].klass.present?
- Avo::App.resources.get_resource_by_model_class @record._reflections[id.to_s].klass.to_s
+ Avo.resource_manager.get_resource_by_model_class @record._reflections[id.to_s].klass.to_s
elsif @record._reflections[id.to_s].options[:class_name].present?
- Avo::App.resources.get_resource_by_model_class @record._reflections[id.to_s].options[:class_name]
+ Avo.resource_manager.get_resource_by_model_class @record._reflections[id.to_s].options[:class_name]
else
- Avo::App.resources.get_resource_by_name id.to_s
+ Avo.resource_manager.get_resource_by_name id.to_s
end
end
def placeholder
@placeholder || I18n.t("avo.choose_an_option")