lib/avo/base_resource.rb in avo-1.7.2 vs lib/avo/base_resource.rb in avo-1.7.3.pre.1
- old
+ new
@@ -320,11 +320,11 @@
end
end
end
def avo_path
- "#{Avo.configuration.root_path}/resources/#{model_class.model_name.route_key}/#{model.id}"
+ "#{Avo::App.root_path}/resources/#{model_class.model_name.route_key}/#{model.id}"
end
def label_field
get_field_definitions.find do |field|
field.as_label.present?
@@ -347,9 +347,11 @@
nil
end
def avatar
return avatar_field.to_image if avatar_field.respond_to? :to_image
+
+ return avatar_field.value.variant(resize_to_limit: [480, 480]) if avatar_field.type == "file"
avatar_field.value
rescue
nil
end