lib/avo/base_resource.rb in avo-2.18.1.pre.1.eagerloaddirs vs lib/avo/base_resource.rb in avo-2.18.1
- old
+ new
@@ -47,11 +47,10 @@
class_attribute :after_create_path, default: :show
class_attribute :after_update_path, default: :show
class_attribute :record_selector, default: true
class_attribute :keep_filters_panel_open, default: false
class_attribute :extra_params
- class_attribute :link_to_child_resource, default: false
class << self
delegate :t, to: ::I18n
delegate :context, to: ::Avo::App
@@ -421,11 +420,13 @@
rescue
nil
end
def label
- label_field&.value || model_title
+ label_field.value || model_title
+ rescue
+ model_title
end
def avatar_field
get_field_definitions.find do |field|
field.as_avatar.present?
@@ -457,10 +458,12 @@
rescue
nil
end
def description
- description_field&.value
+ description_field.value
+ rescue
+ nil
end
def form_scope
model_class.base_class.to_s.underscore.downcase
end