lib/avo/base_resource.rb in avo-2.11.0 vs lib/avo/base_resource.rb in avo-2.11.1.pre.1
- old
+ new
@@ -1,9 +1,8 @@
module Avo
class BaseResource
extend ActiveSupport::DescendantsTracker
- extend HasContext
include ActionView::Helpers::UrlHelper
include Avo::Concerns::HasModel
include Avo::Concerns::HasFields
include Avo::Concerns::HasStimulusControllers
@@ -16,10 +15,11 @@
delegate :main_app, to: :view_context
delegate :avo, to: :view_context
delegate :resource_path, to: :view_context
delegate :resources_path, to: :view_context
delegate :t, to: ::I18n
+ delegate :context, to: ::Avo::App
attr_accessor :view
attr_accessor :model
attr_accessor :reflection
attr_accessor :user
@@ -48,10 +48,11 @@
class_attribute :record_selector, default: true
class_attribute :keep_filters_panel_open, default: false
class << self
delegate :t, to: ::I18n
+ delegate :context, to: ::Avo::App
def grid(&block)
grid_collector = GridCollector.new
grid_collector.instance_eval(&block)
@@ -240,13 +241,9 @@
view_types = [:table]
view_types << :grid if get_grid_fields.present?
view_types
- end
-
- def context
- self.class.context
end
def attached_file_fields
get_field_definitions.select do |field|
[Avo::Fields::FileField, Avo::Fields::FilesField].include? field.class